From fb0acddb3fdcbfbcfbeb874326b8a6c6d3b8a976 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 14 Dec 2020 16:13:38 +0800 Subject: [PATCH] =?UTF-8?q?12=E4=BB=BD=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 --- .../CompanyStatementPoolController.class.php | 13 +++++-- .../Controller/PaymentController.class.php | 37 ++++++++++++++++--- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index c545dcbce..30714b6fb 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -1070,8 +1070,10 @@ class CompanyStatementPoolController extends ThinkController return; } } - - M("company_statement_info","tab_")->where("pool_id={$id}")->save(['verify_status'=>0,'pay_verify_status'=>0,'verify_time'=>'','verify_member_id'=>0]); + //线上打款审核状态撤回 + M("company_statement_info","tab_")->where("pool_id={$id}")->save(['pay_verify_status'=>0,'verify_time'=>'','verify_member_id'=>0]); + //线上打款支付宝状态撤回 + M("company_statement_info","tab_")->where("pool_id={$id} and verify_status != 2")->save(['verify_status'=>0]); foreach ($company_statement_info as $key => $value) { $is_hav = M("pay_statement_info","tab_")->where(['statement_info_id'=>$value['id']])->find(); @@ -1849,12 +1851,13 @@ class CompanyStatementPoolController extends ThinkController $limit_amount = 50000; - $dbres = $this->DBModel->field("id")->where("id in ({$ids})")->select(); + $dbres = $this->DBModel->field("id,company_type")->where("id in ({$ids})")->select(); foreach($dbres as $key=>$value){ $statement_data_info = M("company_statement_info","tab_") ->where(['pool_id'=>$value['id']]) ->select(); + if ($value['company_type'] == 2){ //循环info汇总详单 foreach ($statement_data_info as $skey => $svalue) { @@ -1879,6 +1882,7 @@ class CompanyStatementPoolController extends ThinkController $save = []; $handle_statement = []; +// dump($handle_data); //将同一时间的汇总详单记录起来 foreach ($handle_data as $hk => $hv) { $statement_time = explode('-', $hk); @@ -1891,7 +1895,7 @@ class CompanyStatementPoolController extends ThinkController $game_list = $shv['game_list']; foreach ($game_list as $gk => $gv) { - $statement_money += $gv['sum_money']; + $statement_money += $gv['sum_money']+$gv['reward']+$gv['reward']-$gv['fine']; } } @@ -2018,6 +2022,7 @@ class CompanyStatementPoolController extends ThinkController } } } + } } diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php index 223bb41a5..1c6faaa13 100644 --- a/Application/Payment/Controller/PaymentController.class.php +++ b/Application/Payment/Controller/PaymentController.class.php @@ -420,6 +420,7 @@ class PaymentController extends BaseController // $val['ratio'] = 0; // } // } + $val['sum_money'] = $val['sum_money']-$val['fine']+$val['reward']; if (!$val['increment_ratio']) { $val['increment_ratio'] = 0; } @@ -1035,15 +1036,41 @@ class PaymentController extends BaseController ($status == 1)?($status_str = '已审核通过'):($status_str = '已审核拒绝'); + $save = [ + 'pay_verify_status'=>$status, + 'verify_time'=>time(), + 'verify_member_id'=>$member_id + ]; + $verify = M("company_statement_info","tab_") ->where([ 'id'=>['in',$id] ]) - ->save([ - 'pay_verify_status'=>$status, - 'verify_time'=>time(), - 'verify_member_id'=>$member_id - ]); + ->save($save); + + $companyStatementInfo = M("company_statement_info","tab_") + ->where([ + 'id'=>['in',$id] + ]) + ->select(); + + foreach ($companyStatementInfo as $key => $value) { + if ($value['statement_money'] < 0) { + $payres["remark"] = '打款金额非正,直接打款成功'; + + $pay_info = json_encode($payres, JSON_UNESCAPED_UNICODE); + M("company_statement_info","tab_") + ->where([ + 'id'=>['in',$value['id']] + ]) + ->save(['pay_status'=>1,'pay_time'=>time(),'pay_type'=>2,'pay_info'=>$pay_info]); + M("pay_statement_info","tab_") + ->where([ + 'statement_info_id'=>['in',$value['id']] + ]) + ->save(['pay_status'=>1,'pay_time'=>time(),'pay_type'=>2,'pay_info'=>$pay_info]); + } + } if ($verify) { $this->ajaxReturn(['status'=>1,'msg'=>$status_str]);