From eb8478fbb7d5ed91e9ec2b57e69fdec1923c2bee Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 28 Dec 2020 14:59:27 +0800 Subject: [PATCH 1/3] =?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]); From f4027b75b3a32f5ad39f4250a1efd628f16b296e Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 28 Dec 2020 15:10:30 +0800 Subject: [PATCH 2/3] =?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 --- .../Payment/Controller/PaymentController.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php index ba8042410..655b2b400 100644 --- a/Application/Payment/Controller/PaymentController.class.php +++ b/Application/Payment/Controller/PaymentController.class.php @@ -266,6 +266,7 @@ class PaymentController extends BaseController } $title = [ + 'num'=>'序号', 'company_name' => '公司名称', 'statement_time' => '结算时间', 'statement_money' => '结算金额', @@ -289,14 +290,18 @@ class PaymentController extends BaseController // ->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' => "待打款金额: {$sum['unpay_amount']} 打款成功: {$sum['pay_amount']} 打款失败: {$sum['faild_pay_amount']}", ]; $data = array_merge($data,[$sumData]); + + foreach($data as $key => $value) { + + $data[$key]['num'] = $key + 1; + + } // dump($data);die(); data2csv($data,'线上打款',$title); // $this->ajaxReturn(['stauts'=>1,'msg'=>'导出成功']); From ac70fd3f79310460761c5b7a80d8fd3db783bc67 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 28 Dec 2020 15:15:48 +0800 Subject: [PATCH 3/3] =?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 --- Application/Payment/Controller/PaymentController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php index 655b2b400..9d7e7b81a 100644 --- a/Application/Payment/Controller/PaymentController.class.php +++ b/Application/Payment/Controller/PaymentController.class.php @@ -249,7 +249,7 @@ class PaymentController extends BaseController $company_info = json_decode($value['company_info'],true); $data[$key]['ali_user'] = $company_info['ali_user']; $data[$key]['ali_account'] = $company_info['ali_account']; - $data[$key]['statement_time'] = date("Y-m-d H:i:s",$value['statement_begin_time']).'-'.date("Y-m-d H:i:s",$value['statement_end_time']); + $data[$key]['statement_time'] = date("Y-m-d",$value['statement_begin_time']).'-'.date("Y-m-d",$value['statement_end_time']); if($value['pay_check'] == 0){ $v['pay_check_detail'] = "--";