From ce90ddf3adfdd9f1d93e0c859c767f33ad74be4a Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 19 Mar 2021 11:42:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=A8=E5=B9=BF=E5=91=98?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/PlatformController.class.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index 382c16c2a..63e746e58 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -256,12 +256,7 @@ class PlatformController extends ThinkController "pay_status"=>1 ]; D("Spend")->addSubsiteWhere($map); - if(IS_SUBSITE){ - $SpendModel = M("Spend","tab_",SUBSITE_DB); - }else{ - $SpendModel = M("Spend","tab_"); - } - $Payamount = $SpendModel->field("sum(IF(is_check=1,pay_amount,0)) pay_amount,IFNULL(sum(IF(is_check=2,pay_amount,0)),0) unpay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select(); + $Payamount = SM("Spend","tab_")->field("sum(IF(is_check=1,pay_amount,0)) pay_amount,IFNULL(sum(IF(is_check=2,pay_amount,0)),0) unpay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select(); if(empty($Payamount)) return ; foreach ($Payamount as $v) { $list[$v['paytime']]['payamount'] = $v['pay_amount']; @@ -276,12 +271,7 @@ class PlatformController extends ThinkController "pay_time"=>["between",$yearMap], "pay_status"=>1 ]; - if(IS_SUBSITE){ - $SpendModel = M("Spend","tab_",SUBSITE_DB); - }else{ - $SpendModel = M("Spend","tab_"); - } - $Payamount = $SpendModel->field("sum(IF(is_check=2,pay_amount,0)) pay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select(); + $Payamount = SM("Spend","tab_")->field("sum(IF(is_check=2,pay_amount,0)) pay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select(); if(empty($Payamount)) return ; foreach ($Payamount as $v) { $list[$v['paytime']]['unpayamount'] = $v['pay_amount'];