diff --git a/Application/Admin/Controller/FinancialSummarySetController.class.php b/Application/Admin/Controller/FinancialSummarySetController.class.php index 3a51e78d4..1e6e34a1b 100644 --- a/Application/Admin/Controller/FinancialSummarySetController.class.php +++ b/Application/Admin/Controller/FinancialSummarySetController.class.php @@ -266,12 +266,13 @@ class FinancialSummarySetController extends \Think\Controller */ public function setPromoteMoney() { + $SpendModel = SM("spend",'tab_'); $map = array( "payed_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)), "pay_status"=>1, ); D("Spend")->addSubsiteWhere($map,"s"); - $res = $this->SpendModel + $res = $SpendModel ->alias('s') ->field("IFNULL(SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END),0) as cash_count, IFNULL(SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END),0) as balance_coin_count, @@ -358,7 +359,7 @@ class FinancialSummarySetController extends \Think\Controller $unmap = $map; $unmap['is_check'] = 2; - $unSettlementRes = $this->SpendModel + $unSettlementRes = $SpendModel ->alias('s') ->field("IFNULL(SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END),0) as cash_count, IFNULL(SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END),0) as balance_coin_count,