|
@@ -752,7 +752,7 @@ class Client extends Model
|
|
|
return $notes;
|
|
|
}
|
|
|
|
|
|
- public function cmMeasurementsMatrix($_careMonth = null) {
|
|
|
+ public function cmMeasurementsMatrix($_careMonth, $pro = null) {
|
|
|
|
|
|
$days = [];
|
|
|
|
|
@@ -799,9 +799,13 @@ ORDER BY m.ts DESC
|
|
|
// get existing entries for listing
|
|
|
$match->entries = CareMonthEntry::where('care_month_id', $match->care_month_id)
|
|
|
->where('is_removed', false)
|
|
|
- ->where('effective_date', $match->dateYMD)
|
|
|
- ->orderBy('created_at')
|
|
|
- ->get();
|
|
|
+ ->where('effective_date', $match->dateYMD);
|
|
|
+
|
|
|
+ if(!!$pro) {
|
|
|
+ $match->entries = $match->entries->where('pro_id', $pro->id);
|
|
|
+ }
|
|
|
+
|
|
|
+ $match->entries = $match->entries->orderBy('created_at')->get();
|
|
|
|
|
|
if(!isset($days[$match->date])) {
|
|
|
$days[$match->date] = [];
|