|
@@ -46,21 +46,24 @@ class Pro extends Model
|
|
|
}
|
|
|
|
|
|
public function cmRates() {
|
|
|
- return ProRate::where('is_active', true)
|
|
|
+ return ProRate::distinct('code')
|
|
|
+ ->where('is_active', true)
|
|
|
->where('pro_id', $this->id)
|
|
|
->where('code', 'LIKE', 'CM%')
|
|
|
->get();
|
|
|
}
|
|
|
|
|
|
public function rmRates() {
|
|
|
- return ProRate::where('is_active', true)
|
|
|
+ return ProRate::distinct('code')
|
|
|
+ ->where('is_active', true)
|
|
|
->where('pro_id', $this->id)
|
|
|
->where('code', 'LIKE', 'RM%')
|
|
|
->get();
|
|
|
}
|
|
|
|
|
|
public function noteRates() {
|
|
|
- return ProRate::where('is_active', true)
|
|
|
+ return ProRate::distinct('code')
|
|
|
+ ->where('is_active', true)
|
|
|
->where('pro_id', $this->id)
|
|
|
->where('code', 'NOT LIKE', 'CM%')
|
|
|
->where('code', 'NOT LIKE', 'RM%')
|