From 305707d179056b0a83cceb19e780bcd073f5038d Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 14 Jun 2024 17:55:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/logic/WorkbenchLogic.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/app/store/logic/WorkbenchLogic.php b/app/store/logic/WorkbenchLogic.php index e3a2f26db..bb7e57183 100644 --- a/app/store/logic/WorkbenchLogic.php +++ b/app/store/logic/WorkbenchLogic.php @@ -563,10 +563,24 @@ class WorkbenchLogic extends BaseLogic //总的营业额的统计 总的利润的统计 总的成本合集的统计 总的加到保证金的 $all = StoreOrder::where(['paid'=>YesNoEnum::YES,'store_id'=>$params['store_id']]); + + $deposit_all = SystemStore::where('id',$params['store_id']) + ->value('paid_deposit'); + + $cash_all = StoreCashFinanceFlow::where('store_id',$params['store_id']) + ->where('status',YesNoEnum::YES) + ->sum('receipts'); if(isset($params['month']) && $params['month']){ $all = StoreOrder::where(['paid'=>YesNoEnum::YES,'store_id'=>$params['store_id']]) ->whereMonth('create_time', $params['month']) ; + $deposit_all = SystemStore::where('id',$params['store_id']) + ->whereMonth('create_time', $params['month']) + ->value('paid_deposit'); + $cash_all = StoreCashFinanceFlow::where('store_id',$params['store_id']) + ->where('status',YesNoEnum::YES) + ->whereMonth('create_time', $params['month']) + ->sum('receipts'); } $turnover_all = $all ->sum('pay_price'); @@ -574,11 +588,8 @@ class WorkbenchLogic extends BaseLogic ->sum('profit'); $cost_all = $all ->sum('cost'); - $deposit_all = SystemStore::where('id',$params['store_id']) - ->value('paid_deposit'); - $cash_all = StoreCashFinanceFlow::where('store_id',$params['store_id']) - ->where('status',YesNoEnum::YES) - ->sum('receipts'); + + $time = self::getLastSevenDays();