From 0aac0cfad7f279fe95c7e749a1a1374d90fc2633 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Sat, 25 Jul 2020 20:17:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BB=93=E7=AE=97=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatementPoolController.class.php | 56 +++++++++++++++++++ .../CompanyStatementSetController.class.php | 2 +- .../View/CompanyStatementPool/viewPuPool.html | 37 ++++++++++-- 3 files changed, 88 insertions(+), 7 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index efc267025..c9d1e4b49 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -655,6 +655,62 @@ class CompanyStatementPoolController extends ThinkController 'info' => "删除成功" )); } + //不结算 + public function cancelStatement() + { + if(!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; + //获取结算信息 + $v = M("company_statement_info","tab_")->where("id = '{$id}'")->find(); + if(empty($v)){ + $this->error("请勿重复操作"); + } + $pool = M("company_statement_pool","tab_")->where("id = {$v['pool_id']}")->find(); + // dump($pool); + //保存未结算 + $lackcompany =[ + "company_id"=>$v['company_id'], + "company_type"=>$v['company_type'], + "company_name"=>$v['company_name'], + "company_info"=>$v['company_info'], + "statement_money"=>$v['statement_money'], + "pay_amount"=>$v['pay_amount'], + "platform_amount"=>$v['platform_amount'], + "fine"=>$v['fine'], + "reward"=>$v['reward'], + "statement_begin_time"=>$v['statement_begin_time'], + "statement_end_time"=>$v['statement_end_time'], + "is_payment"=>$pool['is_payment'], + "statement_pool_num"=>$pool['statement_num'], + "statement_info"=>$v['statement_info'], + ]; + $l_id = M("company_lack_statement_info","tab_")->add($lackcompany); + + //汇总表 + $pool_data = [ + "id"=>$pool['id'], + 'statement_money'=>$pool['statement_money']-$v['statement_money'], + 'pay_amount'=>$pool['pay_amount']-$v['pay_amount'], + 'fine'=>$pool['fine']-$v['fine'], + 'reward'=>$pool['reward']-$v['reward'], + 'lack_statement_money'=>$pool['lack_statement_money']+$v['statement_money'], + 'lack_platform_amount'=>$pool['lack_platform_amount']-0+$v['platform_amount'] + ]; + // + if(empty($pool_data['create_lack_ids'])){ + $pool_data['create_lack_ids'] = $l_id; + }else{ + $pool_data['create_lack_ids'] = $pool_data['create_lack_ids'].",".$l_id; + } + $info_ids = explode(",",$pool['info_ids']); + $pool_data['info_ids'] =implode(",",array_diff($info_ids,[$id])); + M("company_statement_pool","tab_")->save($pool_data); + M("company_statement_info","tab_")->where("id='{$id}'")->delete(); + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"不结算成功" + )); + } //撤销汇总 public function cancelPool(){ diff --git a/Application/Admin/Controller/CompanyStatementSetController.class.php b/Application/Admin/Controller/CompanyStatementSetController.class.php index d13fb3f66..2ca7cbe75 100644 --- a/Application/Admin/Controller/CompanyStatementSetController.class.php +++ b/Application/Admin/Controller/CompanyStatementSetController.class.php @@ -1047,7 +1047,7 @@ class CompanyStatementSetController extends Controller { * 保存信息汇总信息 */ public function savePromotateUserPool($data){ - if($data['withdraw_type'] == 2 && empty($data['create_lack_ids']) && empty($data['del_lack_ids']) && empty($data['info_ids'])){ //补点为空不重算 + if(empty($data['create_lack_ids']) && empty($data['del_lack_ids']) && empty($data['info_ids'])){ //补点为空不重算 return ; } if($data['statement_money'] == 0){ diff --git a/Application/Admin/View/CompanyStatementPool/viewPuPool.html b/Application/Admin/View/CompanyStatementPool/viewPuPool.html index 6f3749935..f038e2ba6 100644 --- a/Application/Admin/View/CompanyStatementPool/viewPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/viewPuPool.html @@ -118,8 +118,10 @@ 备注 是否结算 + + 操作 - 操作 + @@ -156,14 +158,16 @@ {$com.remark} + + + + 不结算 + + - - - 不结算 - - + @@ -220,5 +224,26 @@ }); }); + $(".no_statement").on("click",function(){ + var id = $(this).data('id'); + $.ajax({ + type: "POST", + url: "{:U('cancelStatement')}", + dataType: 'json', + async: false, + data: {id:id}, + success:function(data){ + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + }else{ + layer.msg("" + data.info + ""); + return false; + } + } + }); + })