From a708b2581d4c4066b875babd39ce257792247874 Mon Sep 17 00:00:00 2001 From: arnaud11g Date: Tue, 5 Sep 2023 22:33:26 +0200 Subject: [PATCH] Trying to fix sandwiches count in WEI admin dashboard (3) --- app/Http/Controllers/Admin/WEIController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/Admin/WEIController.php b/app/Http/Controllers/Admin/WEIController.php index 36dc5fb..719b7b9 100644 --- a/app/Http/Controllers/Admin/WEIController.php +++ b/app/Http/Controllers/Admin/WEIController.php @@ -182,6 +182,10 @@ public function adminGraph() $graphFood = Payment::select(DB::raw('DATE_FORMAT(created_at,\'%d-%m-%Y\') as day'), DB::raw('COUNT(id) as sum')) ->where('type', 'payment') ->whereIn(DB::raw('`amount`%500'), [30, 330]) + ->where(function ($query) { + $query->where(DB::raw('`amount`%500'), 30) + ->orWhere(DB::raw('`amount`%500'), 330); + }) ->where('state', 'paid') ->orderBy('created_at') ->groupBy(DB::raw('DATE_FORMAT(created_at,\'%d-%m-%Y\')'))->get();