From 27aa8400acf3b629195e4ffcf6c84dad6c7d057e Mon Sep 17 00:00:00 2001 From: weizong song Date: Thu, 13 May 2021 12:49:31 +0800 Subject: [PATCH] up --- app/Http/Controllers/Manager/StatisticsController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Manager/StatisticsController.php b/app/Http/Controllers/Manager/StatisticsController.php index 8d82963..3e3fe37 100644 --- a/app/Http/Controllers/Manager/StatisticsController.php +++ b/app/Http/Controllers/Manager/StatisticsController.php @@ -99,7 +99,9 @@ class StatisticsController extends CommonController })->count(); $counts["orders_ongoing_in_today"] = (new Orders())->ofProject($project_id)->whereHas("audits", function($query) { - $query->whereRaw(); + $query->whereRaw("DATEDIFF(`created_at`,now()) = 0") + ->where("field_name","status") + ->where("new_value", Orders::STATUS_ONGOING); })->count(); return response()->json(compact("counts"));