fix: filter dashboard order statistics by current date
This commit is contained in:
parent
ed7918e858
commit
cb11ee9be6
@ -68,6 +68,7 @@ public function __invoke()
|
||||
|
||||
$paymentMethods = DB::table('orders')
|
||||
->select('payment_method as name', DB::raw('COUNT(*) as total'))
|
||||
->whereDate('created_at', $today)
|
||||
->groupBy('payment_method')
|
||||
->get()
|
||||
->map(function ($item) {
|
||||
@ -80,6 +81,7 @@ public function __invoke()
|
||||
|
||||
$orderStatuses = DB::table('orders')
|
||||
->select('order_status as name', DB::raw('COUNT(*) as total'))
|
||||
->whereDate('created_at', $today)
|
||||
->groupBy('order_status')
|
||||
->get()
|
||||
->map(function ($item) {
|
||||
@ -92,6 +94,7 @@ public function __invoke()
|
||||
|
||||
$orderChannels = DB::table('orders')
|
||||
->select('order_channel as name', DB::raw('COUNT(*) as total'))
|
||||
->whereDate('created_at', $today)
|
||||
->groupBy('order_channel')
|
||||
->get()
|
||||
->map(function ($item) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user