|
|
|
|
@ -105,17 +105,17 @@ class StatisticsController extends CommonController
|
|
|
|
|
$query->where("status", Orders::STATUS_ONGOING);
|
|
|
|
|
})->count();
|
|
|
|
|
|
|
|
|
|
$counts["orders_ongoing_in_today"] = (new Orders())->ofProject($project_id)->whereHas("audits", function($query) {
|
|
|
|
|
$query->whereRaw("DATEDIFF(`created_at`,now()) = 0")
|
|
|
|
|
->where("field_name","status")
|
|
|
|
|
->where("new_value", Orders::STATUS_ONGOING);
|
|
|
|
|
})->count();
|
|
|
|
|
|
|
|
|
|
$counts["orders_finished_in_today"] = (new Orders())->ofProject($project_id)->whereHas("audits", function($query) {
|
|
|
|
|
$query->whereRaw("DATEDIFF(`created_at`,now()) = 0")
|
|
|
|
|
->where("field_name","status")
|
|
|
|
|
->where("new_value", Orders::STATUS_FINISHED);
|
|
|
|
|
})->count();
|
|
|
|
|
// $counts["orders_ongoing_in_today"] = (new Orders())->ofProject($project_id)->whereHas("audits", function($query) {
|
|
|
|
|
// $query->whereRaw("DATEDIFF(`created_at`,now()) = 0")
|
|
|
|
|
// ->where("field_name","status")
|
|
|
|
|
// ->where("new_value", Orders::STATUS_ONGOING);
|
|
|
|
|
// })->count();
|
|
|
|
|
//
|
|
|
|
|
// $counts["orders_finished_in_today"] = (new Orders())->ofProject($project_id)->whereHas("audits", function($query) {
|
|
|
|
|
// $query->whereRaw("DATEDIFF(`created_at`,now()) = 0")
|
|
|
|
|
// ->where("field_name","status")
|
|
|
|
|
// ->where("new_value", Orders::STATUS_FINISHED);
|
|
|
|
|
// })->count();
|
|
|
|
|
|
|
|
|
|
if ($request->is_test) {
|
|
|
|
|
dd(DB::getQueryLog());
|
|
|
|
|
|