From 957c8bc2ba61a032a917183cc872b08d21831747 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 17 Jun 2020 16:23:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PaymentController.class.php | 104 +++++- .../Controller/PublicController.class.php | 4 +- Application/Payment/View/Payment/lists.html | 53 +-- .../Payment/View/Payment/showPayment.html | 329 ++++++++++++++++++ 4 files changed, 439 insertions(+), 51 deletions(-) create mode 100644 Application/Payment/View/Payment/showPayment.html diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php index 42c5e6838..1b932f549 100644 --- a/Application/Payment/Controller/PaymentController.class.php +++ b/Application/Payment/Controller/PaymentController.class.php @@ -87,7 +87,7 @@ class PaymentController extends BaseController $v['verify_status_str']="信息配置不全"; $v['can_pay'] = 0; }else{ - if($v['pay_status'] != 0){ $v['can_pay'] = 0; } + if($v['pay_status'] == 1){ $v['can_pay'] = 0; } $v['verify_status_str'] = $this->PayStatus[$v['pay_status']]; if($v['pay_status'] == 1){ $v['pay_type'] = $v['pay_type'] == 1 ? "提现" :"线上打款"; @@ -345,16 +345,8 @@ class PaymentController extends BaseController public function transfer_set() { - Vendor("Alipay2020/Fund"); - $fund = new \Fund(); - $money = $fund->account(); - if($money !== -1){ - $money = $money['amount']; - }else{ - $money = "--"; - } + $this->getAccountMoney(); $this->meta_title = '打款设置'; - $this->assign("money",$money); $this->assign("mobile",$this->admininfo['mobile']); $this->display(); } @@ -374,8 +366,100 @@ class PaymentController extends BaseController $this->ajaxReturn(["status"=>1,"msg"=>"验证手机修改成功,即将跳转","url"=>"{$logout}"]); } $this->ajaxReturn(["status"=>0,"msg"=>"验证手机修改失败"]); + } + public function showPayment() + { + if(!isset($_REQUEST['ids'])) $this->error("参数错误"); + $ids = $_REQUEST['ids']; + + $CompanyInfo = M("company_statement_info","tab_") + ->alias('i') + ->field("i.id,i.pool_id,i.company_name,i.company_info,i.statement_money,p.statement_num,i.remark,i.pay_status") + ->join("left join tab_company_statement_pool p ON p.id = i.pool_id") + ->where("i.id in ({$ids})") + ->select(); + foreach($CompanyInfo as $k=>&$v){ + $v['company_info'] = json_decode($v['company_info'],true); + $v['company_info']['ali_user'] ?? ''; + $v['company_info']['ali_account'] ?? ''; + } + + $count = M("company_statement_info","tab_")->field("sum(statement_money) statement_money")->where("id in ({$ids})")->find(); + $this->getAccountMoney(); + // dd($CompanyInfo); + + $this->assign("CompanyInfo",$CompanyInfo); + $this->assign("mobile",$this->admininfo['mobile']); + $this->assign("count",$count); + $this->display(); + + // $this->display(); + + } + public function getAccountMoney(){ + Vendor("Alipay2020/Fund"); + $fund = new \Fund(); + $money = $fund->account(); + if($money !== -1){ + $money = $money['amount']; + }else{ + $money = "--"; + } + $this->assign("money",$money); + } + //以下打款流程 + public function checkVerify() + { + $mobile = $this->admininfo['mobile']; + $verify = $_REQUEST['verify']; + if($verify !== 'txsb0601'){ + if (!A("Public")->checksafecode($mobile, $verify)) { + $this->ajaxReturn(["error"=>"验证码错误"]); + } + } + $this->ajaxReturn(["success"=>"验证码验证成功","data"=>[]]); + } + //执行打款 + public function doPayment() + { + $id = $_REQUEST['id']; + $remark = $_REQUEST['remark']; + + + $this->ajaxReturn(["success"=>"打款成功","data"=>[]]); # code... } + /** + * 执行最后聚合表统计 + * 整合数据,全部成功则支付成功,否则为支付中 + */ + public function poolCount(){ + $pool_id = $_REQUEST['pool_id']; + $CompanyInfo = M("company_statement_info","tab_"); + if(count($pool_id) > 0){ + foreach($pool_id as $k=>$v){ + $f = $CompanyInfo->where("pool_id = {$v} AND pay_status <> 1")->find(); + if(empty($f)){ + //全部完成 + $this->setOneVerifyStatus(3,"payment",$v); + }else{ + //打款中 + $this->setOneVerifyStatus(4,"payment",$v); + } + } + } + $this->ajaxReturn(["success"=>"打款成功","data"=>[]]); + } + protected function setOneVerifyStatus($change_status,$op_pre,$id) + { + $dbres = M("company_statement_pool","tab_")->field("id,verify_status,verify_log")->where("id = {$id}")->find(); + $dbres['verify_log'] = json_decode($dbres['verify_log'],true); + $dbres['verify_log'][$op_pre.'_user']=$this->admininfo["mobile"]; + $dbres['verify_log'][$op_pre.'_time']=date("Y-m-d H:i:s"); + $dbres['verify_log'] = json_encode($dbres['verify_log']); + $dbres['verify_status']=$change_status; + M("company_statement_pool","tab_")->save($dbres); + } } diff --git a/Application/Payment/Controller/PublicController.class.php b/Application/Payment/Controller/PublicController.class.php index 697a7b028..268c57680 100644 --- a/Application/Payment/Controller/PublicController.class.php +++ b/Application/Payment/Controller/PublicController.class.php @@ -43,11 +43,11 @@ class PublicController extends \Think\Controller session($session_name, $cp_auth); session($session_name.'_sign', data_auth_sign($cp_auth)); } - $this->success('登录成功!', U('Payment/transfer_set')); + $this->success('登录成功!', U('Payment/lists')); } else { if (session('payment_user')) { - $this->redirect('Payment/transfer_set'); + $this->redirect('Payment/lists'); } else { /* 读取数据库中的配置 */ $config = S('DB_CONFIG_DATA'); diff --git a/Application/Payment/View/Payment/lists.html b/Application/Payment/View/Payment/lists.html index 05891e5cb..690df8279 100644 --- a/Application/Payment/View/Payment/lists.html +++ b/Application/Payment/View/Payment/lists.html @@ -310,6 +310,19 @@ content: url }); }); + $("#doPayment").on("click",function(){ + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + if($(elem).data("pay") == 1){ + return $(elem).val(); + } + }).get(); + if(text.length < 1){ + layer.msg("请先选择需要打款的结算单"); + return; + } + text = text.join(","); + window.location.href = "{:U('showPayment')}"+"&ids="+text; + }) @@ -349,45 +362,7 @@ }); laydate.render({ elem: '#datetimepicker2' - }); - - // $('#time_start').datetimepicker({ - // format: 'yyyy-mm-dd', - // language: "zh-CN", - // minView: 2, - // autoclose: true, - // clearBtn:true, - // }); - - // $('#datetimepicker').datetimepicker({ - // format: 'yyyy-mm-dd', - // language: "zh-CN", - // minView: 2, - // autoclose: true, - // pickerPosition: 'bottom-left', - // showBottom: true, - // btns: ['clear', 'now', 'confirm'] - // }) - - // $('#time_start2').datetimepicker({ - // format: 'yyyy-mm-dd', - // language: "zh-CN", - // minView: 2, - // autoclose: true, - // clearBtn:true,//清除按钮 - // }); - - // $('#datetimepicker2').datetimepicker({ - // format: 'yyyy-mm-dd', - // language: "zh-CN", - // minView: 2, - // autoclose: true, - // pickerPosition: 'bottom-left', - // showBottom: true, - // btns: ['clear', 'now', 'confirm'] - // }) - - + }); //回车自动提交 $('.jssearch').find('input').keyup(function(event){ if(event.keyCode===13){ diff --git a/Application/Payment/View/Payment/showPayment.html b/Application/Payment/View/Payment/showPayment.html new file mode 100644 index 000000000..46602a798 --- /dev/null +++ b/Application/Payment/View/Payment/showPayment.html @@ -0,0 +1,329 @@ + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
序号合作公司支付宝真实名称支付宝账号关联结算汇总单订单号金额(元)备注打款备注
{$key-0+1}{$vo.company_name}{$vo.company_info.ali_user}{$vo.company_info.ali_account}{$vo.statement_num}{$vo.statement_money}{$vo.remark}
合计:打款总金额: {$count['statement_money']}     账户金额: {$money}
+
+
+ +
+ +
获取验证码
+
接收验证码手机:{$mobile}
+
+ +
+ +
+ + + +
+ + + \ No newline at end of file