From da28dcdcc8ef99a5214711da1701a76f89caacc4 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Fri, 19 Aug 2022 14:02:16 +0800 Subject: [PATCH] fixed order report for https://guangdagit.com/beike/beikeshop/issues/135 --- beike/Admin/Repositories/Report/OrderReportRepo.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/beike/Admin/Repositories/Report/OrderReportRepo.php b/beike/Admin/Repositories/Report/OrderReportRepo.php index 1dfbdaa8..389edf73 100644 --- a/beike/Admin/Repositories/Report/OrderReportRepo.php +++ b/beike/Admin/Repositories/Report/OrderReportRepo.php @@ -26,13 +26,13 @@ class OrderReportRepo */ public static function getLatestMonth() { - $orderTotals = OrderRepo::getListBuilder(['start' => today()->subMonth(), 'end' => today()->subDay()]) + $orderTotals = OrderRepo::getListBuilder(['start' => today()->subMonth(), 'end' => today()]) ->select(DB::raw('DATE(created_at) as date, count(*) as total')) ->groupBy('date') ->get() ->keyBy('date'); - $orderAmounts = OrderRepo::getListBuilder(['start' => today()->subMonth(), 'end' => today()->subDay()]) + $orderAmounts = OrderRepo::getListBuilder(['start' => today()->subMonth(), 'end' => today()]) ->select(DB::raw('DATE(created_at) as date, sum(total) as amount')) ->groupBy('date') ->get() @@ -64,13 +64,13 @@ class OrderReportRepo */ public static function getLatestWeek() { - $orderTotals = OrderRepo::getListBuilder(['start' => today()->subWeek(), 'end' => today()->subDay()]) + $orderTotals = OrderRepo::getListBuilder(['start' => today()->subWeek(), 'end' => today()]) ->select(DB::raw('DATE(created_at) as date, count(*) as total')) ->groupBy('date') ->get() ->keyBy('date'); - $orderAmounts = OrderRepo::getListBuilder(['start' => today()->subWeek(), 'end' => today()->subDay()]) + $orderAmounts = OrderRepo::getListBuilder(['start' => today()->subWeek(), 'end' => today()]) ->select(DB::raw('DATE(created_at) as date, sum(total) as amount')) ->groupBy('date') ->get() @@ -102,7 +102,7 @@ class OrderReportRepo */ public static function getLatestYear() { - $orderTotals = OrderRepo::getListBuilder(['start' => today()->subYear(), 'end' => today()->subDay()]) + $orderTotals = OrderRepo::getListBuilder(['start' => today()->subYear(), 'end' => today()]) ->select(DB::raw('YEAR(created_at) as year, MONTH(created_at) as month, count(*) as total')) ->groupBy(['year', 'month']) ->get(); @@ -112,7 +112,7 @@ class OrderReportRepo $orderMonthTotals[$key] = $orderTotal['total']; } - $orderAmounts = OrderRepo::getListBuilder(['start' => today()->subYear(), 'end' => today()->subDay()]) + $orderAmounts = OrderRepo::getListBuilder(['start' => today()->subYear(), 'end' => today()]) ->select(DB::raw('YEAR(created_at) as year, MONTH(created_at) as month, sum(total) as amount')) ->groupBy(['year', 'month']) ->get();