|
@@ -2384,17 +2384,16 @@ WHERE
|
|
$stats['withMeasOn'] = 'N/A';
|
|
$stats['withMeasOn'] = 'N/A';
|
|
$v = $request->input('wmo') ?: date('Y-m-d');
|
|
$v = $request->input('wmo') ?: date('Y-m-d');
|
|
$statQuery = "$commonStatSQL
|
|
$statQuery = "$commonStatSQL
|
|
-(SELECT COUNT(mstat.id) FROM measurement mstat WHERE mstat.care_month_id = care_month.id AND mstat.created_at::date = '$v' AND mstat.is_cellular_zero IS FALSE) > 0 AND
|
|
|
|
|
|
+(SELECT COUNT(mstat.id) FROM measurement mstat WHERE mstat.care_month_id = care_month.id AND mstat.ts_date_time::date = '$v' AND mstat.is_cellular_zero IS FALSE) > 0 AND
|
|
" . (count($conditions) > 0 ? implode(" AND ", $conditions) : '1') . "
|
|
" . (count($conditions) > 0 ? implode(" AND ", $conditions) : '1') . "
|
|
";
|
|
";
|
|
- dd($statQuery);
|
|
|
|
$statResult = DB::select($statQuery);
|
|
$statResult = DB::select($statQuery);
|
|
$stats['withMeasOn'] = $statResult[0]->count;
|
|
$stats['withMeasOn'] = $statResult[0]->count;
|
|
|
|
|
|
$stats['noMeasOn'] = 'N/A';
|
|
$stats['noMeasOn'] = 'N/A';
|
|
$v = $request->input('nmo') ?: date('Y-m-d');
|
|
$v = $request->input('nmo') ?: date('Y-m-d');
|
|
$statQuery = "$commonStatSQL
|
|
$statQuery = "$commonStatSQL
|
|
-(SELECT COUNT(mstat.id) FROM measurement mstat WHERE mstat.care_month_id = care_month.id AND mstat.created_at::date = '$v' AND mstat.is_cellular_zero IS FALSE) = 0 AND
|
|
|
|
|
|
+(SELECT COUNT(mstat.id) FROM measurement mstat WHERE mstat.care_month_id = care_month.id AND mstat.ts_date_time::date = '$v' AND mstat.is_cellular_zero IS FALSE) = 0 AND
|
|
" . (count($conditions) > 0 ? implode(" AND ", $conditions) : '1') . "
|
|
" . (count($conditions) > 0 ? implode(" AND ", $conditions) : '1') . "
|
|
";
|
|
";
|
|
$statResult = DB::select($statQuery);
|
|
$statResult = DB::select($statQuery);
|