fix: filter dashboard order statistics by current date

This commit is contained in:
Yoga Pangestu 2026-04-23 13:28:29 +07:00
parent ed7918e858
commit cb11ee9be6

View File

@ -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) {