|
@@ -44,4 +44,26 @@ class Pro extends Model
|
|
|
$numRates = ProRate::where('is_active', true)->where('pro_id', $this->id)->count();
|
|
|
return $numRates > 0;
|
|
|
}
|
|
|
+
|
|
|
+ public function cmRates() {
|
|
|
+ return ProRate::where('is_active', true)
|
|
|
+ ->where('pro_id', $this->id)
|
|
|
+ ->where('code', 'LIKE', 'CM%')
|
|
|
+ ->get();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function rmRates() {
|
|
|
+ return ProRate::where('is_active', true)
|
|
|
+ ->where('pro_id', $this->id)
|
|
|
+ ->where('code', 'LIKE', 'RM%')
|
|
|
+ ->get();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function noteRates() {
|
|
|
+ return ProRate::where('is_active', true)
|
|
|
+ ->where('pro_id', $this->id)
|
|
|
+ ->where('code', 'NOT LIKE', 'CM%')
|
|
|
+ ->where('code', 'NOT LIKE', 'RM%')
|
|
|
+ ->get();
|
|
|
+ }
|
|
|
}
|