From 380288641556f1fc277ab814232130202ee652f7 Mon Sep 17 00:00:00 2001 From: lq Date: Fri, 11 Oct 2024 10:44:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=A3=E4=BB=98=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/controllers/base/ChargeCashController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/admin/controllers/base/ChargeCashController.php b/admin/controllers/base/ChargeCashController.php index 7638e30..8f247f9 100644 --- a/admin/controllers/base/ChargeCashController.php +++ b/admin/controllers/base/ChargeCashController.php @@ -63,7 +63,6 @@ class ChargeCashController extends BaseAdminController $total = 0; foreach ($list as $item) { if ($item->updated_at >= strtotime(date('Y-m-d'))) { - $today = bcadd($today, $item->charge_cash, 2); $total = bcadd($total, $item->charge_cash, 2); $week = bcadd($week, $item->charge_cash, 2); $month = bcadd($month, $item->charge_cash, 2); @@ -73,13 +72,19 @@ class ChargeCashController extends BaseAdminController $total = bcadd($total, $item->charge_cash, 2); $week = bcadd($week, $item->charge_cash, 2); $month = bcadd($month, $item->charge_cash, 2); + $yesterday = bcadd($yesterday, $item->charge_cash, 2); } elseif ($item->updated_at >= strtotime(date('Y-m-d', strtotime('-7 day'))) && $item->updated_at < strtotime(date('Y-m-d', strtotime('-1 day')))) { $week = bcadd($week, $item->charge_cash, 2); $total = bcadd($total, $item->charge_cash, 2); $month = bcadd($month, $item->charge_cash, 2); - } elseif ($item->updated_at >= strtotime(date('Y-m-01')) && $item->updated_at < strtotime(date('Y-m-d', strtotime('-7 day')))) { + $yesterday = bcadd($yesterday, $item->charge_cash, 2); + } elseif ($item->updated_at >= strtotime(date('Y-m-01'))) { $month = bcadd($month, $item->charge_cash, 2); $total = bcadd($total, $item->charge_cash, 2); + $yesterday = bcadd($yesterday, $item->charge_cash, 2); + } elseif ($item->updated_at >= strtotime(date('Y-01-01'))) { + $yesterday = bcadd($yesterday, $item->charge_cash, 2); + $total = bcadd($total, $item->charge_cash, 2); } else { $total = bcadd($total, $item->charge_cash, 2); }