Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
Trying to fix sandwiches count in WEI admin dashboard (3)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud11g committed Sep 5, 2023
1 parent c50161f commit a708b25
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Http/Controllers/Admin/WEIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a708b25

Please sign in to comment.