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')
|
$paymentMethods = DB::table('orders')
|
||||||
->select('payment_method as name', DB::raw('COUNT(*) as total'))
|
->select('payment_method as name', DB::raw('COUNT(*) as total'))
|
||||||
|
->whereDate('created_at', $today)
|
||||||
->groupBy('payment_method')
|
->groupBy('payment_method')
|
||||||
->get()
|
->get()
|
||||||
->map(function ($item) {
|
->map(function ($item) {
|
||||||
@ -80,6 +81,7 @@ public function __invoke()
|
|||||||
|
|
||||||
$orderStatuses = DB::table('orders')
|
$orderStatuses = DB::table('orders')
|
||||||
->select('order_status as name', DB::raw('COUNT(*) as total'))
|
->select('order_status as name', DB::raw('COUNT(*) as total'))
|
||||||
|
->whereDate('created_at', $today)
|
||||||
->groupBy('order_status')
|
->groupBy('order_status')
|
||||||
->get()
|
->get()
|
||||||
->map(function ($item) {
|
->map(function ($item) {
|
||||||
@ -92,6 +94,7 @@ public function __invoke()
|
|||||||
|
|
||||||
$orderChannels = DB::table('orders')
|
$orderChannels = DB::table('orders')
|
||||||
->select('order_channel as name', DB::raw('COUNT(*) as total'))
|
->select('order_channel as name', DB::raw('COUNT(*) as total'))
|
||||||
|
->whereDate('created_at', $today)
|
||||||
->groupBy('order_channel')
|
->groupBy('order_channel')
|
||||||
->get()
|
->get()
|
||||||
->map(function ($item) {
|
->map(function ($item) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user