From 65dc1dec9e78401414ce9d5ee3948d9abcc40534 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 3 Sep 2020 16:56:19 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E8=A1=A5=E7=82=B9?= =?UTF-8?q?=E5=8A=9F=E8=83=BDbug=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/CompanyStatementController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index f0fd336da..c0353a959 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -1368,7 +1368,7 @@ class CompanyStatementController extends ThinkController $statement_data = []; M()->startTrans(); foreach ($data as $key => $value) { - + $statement_data = []; $company_data = M("promote_company","tab_")->where(['id'=>$value['company_id']])->find(); $company_type = M("company_relation","tab_")->where("first_company_id={$value['company_id']} or second_company_id={$value['company_id']}")->find(); From ab7ae8063449322e1fed638f6fae9c185e9c069e Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 3 Sep 2020 18:04:17 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=A1=A5=E7=82=B9bug=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatementController.class.php | 35 +++++++++++++++++-- .../CompanyStatementPoolController.class.php | 7 +++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index c0353a959..e6bc5ed65 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -1368,14 +1368,16 @@ class CompanyStatementController extends ThinkController $statement_data = []; M()->startTrans(); foreach ($data as $key => $value) { + $begin_time = 99999999999; + $end_time = 0; $statement_data = []; $company_data = M("promote_company","tab_")->where(['id'=>$value['company_id']])->find(); $company_type = M("company_relation","tab_")->where("first_company_id={$value['company_id']} or second_company_id={$value['company_id']}")->find(); $insert['is_payment'] = $company_type['is_payment']; - $insert['statement_begin_time'] = strtotime($value['statement_begin_time']); - $insert['statement_end_time'] = strtotime($value['statement_end_time']); +// $insert['statement_begin_time'] = strtotime($value['statement_begin_time']); +// $insert['statement_end_time'] = strtotime($value['statement_end_time']); $insert['withdraw_type'] = $withdraw_type; $insert['company_belong'] = $company_data['company_belong']; $insert['company_name'] = $company_data['company_name']; @@ -1470,12 +1472,23 @@ class CompanyStatementController extends ThinkController $amount_time['pay_way'] = ['egt',0]; foreach ($statement_info as $k => $v) { + $statement_begin_time = strtotime(str_replace('.','-',$v['statement_begin_time'])); $statement_end_time = strtotime(str_replace('.','-',$v['statement_end_time']))+86399; + if ($statement_begin_time<$begin_time) { + $begin_time = $statement_begin_time; + } + + if ($statement_end_time>$end_time) { + $end_time = $statement_end_time; + } + + $amount_time['_string'] = "payed_time between {$statement_begin_time} and {$statement_end_time} and relation_game_id={$v['relation_game_id']}"; $dataAmount = M("spend","tab_") - ->field("pay_amount,relation_game_id,relation_game_name,payed_time,game_type_name,substring_index(substring_index(promote.`chain`,'/',2),'/',-1) promote_id,chain,admin_id") + ->field("pay_amount,relation_game_id,relation_game_name,payed_time,game_type_name, + CASE WHEN substring_index(substring_index(`chain`,'/',2),'/',-1) !='' THEN substring_index(substring_index(`chain`,'/',2),'/',-1) ELSE promote_id END promote_id,chain,admin_id") ->join("left join tab_promote promote on tab_spend.promote_id=promote.id") ->join("left join tab_game game on tab_spend.game_id=game.id") ->where($amount_time) @@ -1525,9 +1538,25 @@ class CompanyStatementController extends ThinkController $insert['statement_info'] = json_encode($statement_insert); } else { + $insert['statement_info'] = json_encode($statement_info); + foreach ($statement_info as $k => $v) { + $statement_begin_time = strtotime(str_replace('.','-',$v['statement_begin_time'])); + $statement_end_time = strtotime(str_replace('.','-',$v['statement_end_time']))+86399; + + if ($statement_begin_time<$begin_time) { + $begin_time = $statement_begin_time; + } + + if ($statement_end_time>$end_time) { + $end_time = $statement_end_time; + } + } } + $insert['statement_begin_time'] = $begin_time; + $insert['statement_end_time'] = $end_time; + if ($company_type['first_company_id'] == $value['company_id']) { $insert['first_party_info'] = json_encode($proCompany_info); $insert['second_party_info'] = json_encode($secord_info); diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index 34a6fa726..72ac9b7d5 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -799,7 +799,12 @@ class CompanyStatementPoolController extends ThinkController if($re_op){ //公司及上游回退 if($db_res['company_type'] == 2){ - $this->retry($db_res); //个人重算 + + if($db_res['withdraw_type'] == 3) { + $this->cancelCompanyPool($db_res);//公司撤回 + } else { + $this->retry($db_res); //个人重算 + } }else{ $this->cancelCompanyPool($db_res);//公司撤回 } From ba1778c112f600ce2e8ebff30f12ee474d483b6d Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 3 Sep 2020 18:20:29 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=85=AC=E5=8F=B8=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=AE=9D=E6=89=93=E6=AC=BE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/PromoteCompany/edit.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/View/PromoteCompany/edit.html b/Application/Admin/View/PromoteCompany/edit.html index 842c120a9..c064a26d4 100644 --- a/Application/Admin/View/PromoteCompany/edit.html +++ b/Application/Admin/View/PromoteCompany/edit.html @@ -421,10 +421,10 @@ 选择否将不能进行线上打款 From 7ef0f125c1db6f9f2062cedd2d4f7f5de307ec09 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Fri, 4 Sep 2020 09:36:48 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E8=A1=A5=E7=82=B9?= =?UTF-8?q?=E5=88=A0=E9=99=A4=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/CompanyStatementController.class.php | 11 ++++++++++- Application/Admin/View/CompanyStatement/lists.html | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index 98feeb66e..f5e6e06d0 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -372,7 +372,16 @@ class CompanyStatementController extends ThinkController public function delStatement(){ if(!isset($_REQUEST['ids'])) $this->error("参数错误"); $ids = $_REQUEST['ids']; - $dbres = $this->DBModel->where("id in ({$ids}) and verify_status = 0")->delete(); +// $dbres = $this->DBModel->where("id in ({$ids}) and verify_status = 0")->delete(); + $dbres = $this->DBModel->where("id in ({$ids})")->select(); + foreach ($dbres as $key=>$value) { + if($value['withdraw_type'] !=3) { + $this->DBModel->where("id = {$value['id']} and verify_status = 0")->delete(); + } else { + $this->DBModel->where("id = {$value['id']}")->delete(); + } + + } addOperationLog(['op_type'=>2,'key'=>$ids,"op_name"=>"删除结算单",'url'=>U('lists')]); $this->ajaxReturn(array( 'status' => 1, diff --git a/Application/Admin/View/CompanyStatement/lists.html b/Application/Admin/View/CompanyStatement/lists.html index bc77a6907..824f5671c 100644 --- a/Application/Admin/View/CompanyStatement/lists.html +++ b/Application/Admin/View/CompanyStatement/lists.html @@ -494,6 +494,10 @@ var flag = false; var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + if (id=="delStatement"&&$(elem).data("type")==3) { + return $(elem).val(); + } + if($.inArray( $(elem).data("status"),status) == -1||(id=="updateStatement" && $(elem).data("type")==3)){ flag = true; }else{ From c1222cd46a0100f6245589d61bedcabdf9e81993 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Fri, 4 Sep 2020 10:42:26 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E8=A1=A5=E7=82=B9?= =?UTF-8?q?=E6=AF=94=E4=BE=8B=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatement/viewSpecialComplement.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html index 3a0cc3dc3..7094ad59f 100644 --- a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html +++ b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html @@ -236,13 +236,15 @@ format: 'yyyy-mm-dd', language:"zh-CN", minView:2, - autoclose:true + autoclose:true, + endDate : new Date() }); $('#time_end').datetimepicker({ format: 'yyyy-mm-dd', language:"zh-CN", minView:2, - autoclose:true + autoclose:true, + endDate : new Date() }); $('#datetimepicker').datetimepicker({ @@ -572,6 +574,8 @@ $('.complement').change(function() { //获取总流水 var pay_amount = parseFloat($(this).parent().prev().prev().text()); + var show_ratio = $(this).parent().prev().text(); + show_ratio = parseFloat(show_ratio.slice(0,show_ratio.length-1)); //计算最终分配比率 var ratio = parseFloat($(this).val()); @@ -580,10 +584,10 @@ $(this).val(0); ratio = 0; } - - if (ratio>100) { - $(this).val(100); - ratio = 100; + // console.log(ratio+show_ratio); + if ((ratio+show_ratio)>100) { + $(this).val(100-show_ratio); + ratio = 100-show_ratio; } //最终的分配金额 var withdraw_amount = ((pay_amount * ratio)/100).toFixed(2); From 95799193754292f5480076ee5177afd96f52d750 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Fri, 4 Sep 2020 12:12:51 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=AF=94=E4=BE=8B=E7=A9=BA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/View/CompanyStatement/viewSpecialComplement.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html index 7094ad59f..b23770a61 100644 --- a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html +++ b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html @@ -535,10 +535,10 @@ } $('#tablebox').find('tbody').prepend(html); - complementChange(); DeleteTd(); caculateAmount(); + } } else { @@ -584,6 +584,10 @@ $(this).val(0); ratio = 0; } + if(!ratio) { + $(this).val(0); + ratio=0; + } // console.log(ratio+show_ratio); if ((ratio+show_ratio)>100) { $(this).val(100-show_ratio); @@ -596,6 +600,7 @@ caculateAmount(); }); } + //删除操作 function DeleteTd() {