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); }