From e8fc25259908c42cc8a1831137f7d20140ea9577 Mon Sep 17 00:00:00 2001 From: zyx Date: Thu, 31 Oct 2019 17:41:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E9=95=BF=E7=BB=9F=E8=AE=A1=E6=90=9C?= =?UTF-8?q?=E7=B4=A2bug=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/ExportController.class.php | 15 +++++++++------ .../Admin/Controller/FinanceController.class.php | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 23c9fa173..26a59d0d9 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -5658,17 +5658,20 @@ if ($key == 'model'){ ->where($map) ->group('promote_id') ->select(); - - $xlsData = array_merge($parentData,$xlsData); + if (empty(I("root_name"))) { + $xlsData = array_merge($parentData, $xlsData); + } $sumData = M('spend_user_count','tab_') ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count') ->where($map) ->find(); - $sumData['cash_count'] = number_format($sumData['cash_count']+$parentData[0]['cash_count'],2,'.',''); - $sumData['balance_coin_count'] = number_format($sumData['balance_coin_count']+$parentData[0]['balance_coin_count'],2,'.',''); - $sumData['inside_cash_count'] = number_format($sumData['inside_cash_count']+$parentData[0]['inside_cash_count'],2,'.',''); - $sumData['all_count'] = number_format($sumData['all_count']+$parentData[0]['all_count'],2,'.',''); + if (empty(I("root_name"))) { + $sumData['cash_count'] = number_format($sumData['cash_count'] + $parentData[0]['cash_count'], 2, '.', ''); + $sumData['balance_coin_count'] = number_format($sumData['balance_coin_count'] + $parentData[0]['balance_coin_count'], 2, '.', ''); + $sumData['inside_cash_count'] = number_format($sumData['inside_cash_count'] + $parentData[0]['inside_cash_count'], 2, '.', ''); + $sumData['all_count'] = number_format($sumData['all_count'] + $parentData[0]['all_count'], 2, '.', ''); + } $sumData = [['promote_account'=>'总计', 'cash_count'=>$sumData['cash_count'], diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 8464863f1..e2e453ae1 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -400,17 +400,20 @@ class FinanceController extends ThinkController ->group('promote_id') ->page($page,$row) ->select(); - - $subQueryAll = array_merge($parentData,$subQueryAll); + if (empty(I("root_name"))) { + $subQueryAll = array_merge($parentData,$subQueryAll); + } $sumData = M('spend_user_count','tab_') ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count') ->where($map) ->find(); - $sumData['cash_count'] = number_format($sumData['cash_count']+$parentData[0]['cash_count'],2,'.',''); - $sumData['balance_coin_count'] = number_format($sumData['balance_coin_count']+$parentData[0]['balance_coin_count'],2,'.',''); - $sumData['inside_cash_count'] = number_format($sumData['inside_cash_count']+$parentData[0]['inside_cash_count'],2,'.',''); - $sumData['all_count'] = number_format($sumData['all_count']+$parentData[0]['all_count'],2,'.',''); + if (empty(I("root_name"))) { + $sumData['cash_count'] = number_format($sumData['cash_count'] + $parentData[0]['cash_count'], 2, '.', ''); + $sumData['balance_coin_count'] = number_format($sumData['balance_coin_count'] + $parentData[0]['balance_coin_count'], 2, '.', ''); + $sumData['inside_cash_count'] = number_format($sumData['inside_cash_count'] + $parentData[0]['inside_cash_count'], 2, '.', ''); + $sumData['all_count'] = number_format($sumData['all_count'] + $parentData[0]['all_count'], 2, '.', ''); + } $count = M('spend_user_count','tab_') ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')