From 24f2b76bd6b17efe88349debd6220e303de98e8f Mon Sep 17 00:00:00 2001 From: chenzhi Date: Mon, 6 Jul 2020 20:24:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExcelPaymentController.class.php | 30 +++ .../Payment/View/ExcelPayment/add.html | 214 +++++++++++------- Data/update.sql | 1 - 3 files changed, 156 insertions(+), 89 deletions(-) diff --git a/Application/Payment/Controller/ExcelPaymentController.class.php b/Application/Payment/Controller/ExcelPaymentController.class.php index 66a236540..99f717022 100644 --- a/Application/Payment/Controller/ExcelPaymentController.class.php +++ b/Application/Payment/Controller/ExcelPaymentController.class.php @@ -141,6 +141,36 @@ class ExcelPaymentController extends BaseController { $this->display(); } + // + public function loopAdd() + { + $p = $_REQUEST; + $statement_begin_time = strtotime($p['statement_begin_time']); + $statement_end_time = strtotime($p['statement_end_time'])+86399; + $batch = $p['batch']; + $checkarr = $p['checkarr']; + //循环获取添加 + if(count($checkarr) < 1){ + $this->ajaxReturn(["status"=>1,"msg"=>"ok"]); + } + $ExcelStatementInfo = M('ExcelStatementInfo',"tab_"); + foreach ($checkarr as $k => &$v) { + $v['statement_begin_time'] = $statement_begin_time; + $v['statement_end_time'] = $statement_end_time; + $v['batch_num'] = $batch; + $v['statement_info'] = json_encode($v['statement_info'],JSON_UNESCAPED_UNICODE); + $v['company_info'] = json_encode($v['company_info'],JSON_UNESCAPED_UNICODE); + $v['company_type'] = 2; + $v['create_time'] = time(); + $v['statement_num'] = "JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5); + $res = $ExcelStatementInfo->add($v); + if($res === false){ + M('ExcelStatementInfo')->where("statement_num = '{$v['statement_num']}'")->delete(); + $this->ajaxReturn(["status"=>0,"msg"=>"添加失败"]); + } + } + $this->ajaxReturn(["status"=>1,"msg"=>"ok"]); + } //查看 public function viewPool() { diff --git a/Application/Payment/View/ExcelPayment/add.html b/Application/Payment/View/ExcelPayment/add.html index f07a572b3..d4baba145 100644 --- a/Application/Payment/View/ExcelPayment/add.html +++ b/Application/Payment/View/ExcelPayment/add.html @@ -29,7 +29,31 @@ - + + + + + + + + + +
*Excel文件上传:本次批次号: +
+
+ 用于检索使用 +
*结算时间: +
+ +  -  +
+ + +
+
+ 用于检索及唯一值检验 +
*文件上传:
@@ -37,6 +61,7 @@ 暂只支持.xls .xlsx 格式文件
@@ -52,12 +77,12 @@ -
+
文件格式参考:请严格按此格式,文件的第一行必须是字段名,且字段名不允许修改
@@ -144,11 +169,11 @@ url: url, data:senddata, success: function(data) { - if(data.success){ - callback(data.data); + if(data.status == 1){ + callback(); }else{ MSG.hidemsg(); - layer.alert(data.error); + layer.alert(data.msg); return false; } @@ -160,102 +185,69 @@ } }); }, - //创建面单 - creatCompare:function(senddata,callback){ - COMPARE.publiucAjax("{:U('creatCompare')}",senddata,function(data){ - sendDefaultData.compare_id = data.id; - MSG.showmsg("初始化完成,开始比较数据 [0/"+sendDefaultData.filedata_count+"] ......"); - callback(); - }); - }, //循环比较 loopCheck:function(page,callback){ if(page > sendDefaultData.check_page){ - MSG.showmsg("生成平台 游戏流水比对订单,此过程需要较长时间,请耐心等待......"); + MSG.showmsg("添加成功,执行跳转中"); callback(); return; } var senddata = { - keys:sendDefaultData.keys, - compare_id:sendDefaultData.compare_id, - pay_way:sendDefaultData.pay_way, + statement_begin_time:sendDefaultData.begin_time, + statement_end_time:sendDefaultData.end_time, + batch:sendDefaultData.batch, checkarr:sendDefaultData.filedata.splice(0,check_size) } - COMPARE.publiucAjax("{:U('compareData')}",senddata,function(data){ + COMPARE.publiucAjax("{:U('loopAdd')}",senddata,function(data){ var checkok = page*check_size > sendDefaultData.filedata_count ? sendDefaultData.filedata_count : page*check_size; - MSG.showmsg("比较数据 ["+checkok+"/"+sendDefaultData.filedata_count+"] ......"); + MSG.showmsg("数据插入 ["+checkok+"/"+sendDefaultData.filedata_count+"] ......"); page++; COMPARE.loopCheck(page,callback) }); - }, - //生成游戏订单平台缺失订单 - checkSpendData:function(callback){ - var senddata = { - compare_id:sendDefaultData.compare_id, - pay_way:sendDefaultData.pay_way, - begin_time:sendDefaultData.begin_time, - end_time:sendDefaultData.end_time, - } - COMPARE.publiucAjax("{:U('checkSpendData')}",senddata,function(data){ - MSG.showmsg("生成平台 平台币比对订单......"); - console.log(data) - callback(); - }); - }, - //生成游戏订单平台缺失订单 - checkDepositData:function(callback){ - var senddata = { - compare_id:sendDefaultData.compare_id, - pay_way:sendDefaultData.pay_way, - begin_time:sendDefaultData.begin_time, - end_time:sendDefaultData.end_time, - } - COMPARE.publiucAjax("{:U('checkDepositData')}",senddata,function(data){ - MSG.showmsg("生成最后比较统计......"); - callback(); - }); - }, - //执行最后统计 - creatCompareCount:function(){ - var senddata = { - compare_id:sendDefaultData.compare_id, - }; - COMPARE.publiucAjax("{:U('creatCompareCount')}",senddata,function(data){ - MSG.showmsg("导入比较成功,执行跳转中......"); - setTimeout(function(){ - window.location.href = "{:U('index')}"; - },2000) - }); } - }