From eb8478fbb7d5ed91e9ec2b57e69fdec1923c2bee Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 28 Dec 2020 14:59:27 +0800 Subject: [PATCH] =?UTF-8?q?12.28=E5=8A=9F=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PaymentController.class.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php index b3182acaa..ba8042410 100644 --- a/Application/Payment/Controller/PaymentController.class.php +++ b/Application/Payment/Controller/PaymentController.class.php @@ -276,19 +276,24 @@ class PaymentController extends BaseController 'pay_check_detail'=>'打款信息确认', 'pay_status_str'=>'打款状态', 'pay_time'=>'打款时间',]; - $sum = M("pay_statement_info","tab_") - ->alias('s') - ->field("sum(if(s.pay_status=0,s.statement_money,0)) unpay_amount,sum(if(s.pay_status>0,s.statement_money,0)) pay_amount,sum(if(s.pay_status<0,s.statement_money,0)) faild_pay_amount") - ->join("left join tab_company_statement_info c on s.statement_info_id = c.id") + ->alias('c') + ->field("sum(if(c.pay_status=0,c.statement_money,0)) unpay_amount,sum(if(c.pay_status>0,c.statement_money,0)) pay_amount,sum(if(c.pay_status<0,c.statement_money,0)) faild_pay_amount") + ->join("left join tab_company_statement_info s on c.statement_info_id = s.id") ->where(['statement_info_id'=>['in',$id]]) ->find(); +// $sum = M("pay_statement_info","tab_") +// ->alias('s') +// ->field("sum(if(s.pay_status=0,s.statement_money,0)) unpay_amount,sum(if(s.pay_status>0,s.statement_money,0)) pay_amount,sum(if(s.pay_status<0,s.statement_money,0)) faild_pay_amount") +// ->join("left join tab_company_statement_info c on s.statement_info_id = c.id") +// ->where(['statement_info_id'=>['in',$id]]) +// ->find(); $money = M("company_statement_info","tab_")->alias('s')->field("sum(statement_money) statement_money")->where(['s.id'=>['in',$id]])->find(); $sumData = [ 'company_name'=>'合计', - 'statement_time' => "待打款金额: {$money['statement_money']} 打款成功: {$sum['pay_amount']} 打款失败: {$sum['faild_pay_amount']}", + 'statement_time' => "待打款金额: {$sum['unpay_amount']} 打款成功: {$sum['pay_amount']} 打款失败: {$sum['faild_pay_amount']}", ]; $data = array_merge($data,[$sumData]);