|
|
|
|
@ -93,6 +93,15 @@ class StatisticsController extends CommonController
|
|
|
|
|
$query->ofProject($project_id);
|
|
|
|
|
})->sum("total");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$counts["paramedic_has_order"] = (new Paramedic())->ofProject($project_id)->whereHas("orders",function($query) {
|
|
|
|
|
$query->where("status", Orders::STATUS_ONGOING);
|
|
|
|
|
})->count();
|
|
|
|
|
|
|
|
|
|
$counts["orders_ongoing_in_today"] = (new Orders())->ofProject($project_id)->whereHas("audits", function($query) {
|
|
|
|
|
$query->whereRaw();
|
|
|
|
|
})->count();
|
|
|
|
|
|
|
|
|
|
return response()->json(compact("counts"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|