diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index a7984ef22..99958bf56 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -448,15 +448,6 @@ class CompanyStatementController extends ThinkController if(!isset($_REQUEST['ids'])) $this->error("参数错误"); $ids = $_REQUEST['ids']; $dbres = $this->DBModel->field("id,verify_status,verify_log,withdraw_type")->where("id in ({$ids})")->select(); - foreach ($dbres as $key => $value) { - if($value['withdraw_type'] == 3) { - $this->ajaxReturn(array( - 'status' => 0, - "info"=>"特殊补点无法重算" - )); - } - } - foreach($dbres as $k=>&$v){ // if(in_array($v['verify_status'],[3,4])) continue; //合作方确认后不进行重算 diff --git a/Application/Admin/Controller/CompanyStatementLackController.class.php b/Application/Admin/Controller/CompanyStatementLackController.class.php index d28c960f0..4fef420fd 100644 --- a/Application/Admin/Controller/CompanyStatementLackController.class.php +++ b/Application/Admin/Controller/CompanyStatementLackController.class.php @@ -82,6 +82,7 @@ class CompanyStatementLackController extends ThinkController $v['company_type_str'] = $this->CompanyType[$v['company_type']]; $v["valid"] = "{$v['statement_begin_time']}-{$v['statement_end_time']}"; $v['oplist'] = $this->OpAuth($v); + $v['withdraw_type_str'] = ($v['withdraw_type']==3?"特殊补点":"正常结算");; } $count = $this->DBModel->field("count(id) count,sum(statement_money) statement_money")->where($map)->find(); @@ -136,6 +137,21 @@ class CompanyStatementLackController extends ThinkController if(!isset($_REQUEST['ids'])) $this->error("参数错误"); $ids = $_REQUEST['ids']; $dbres = $this->DBModel->field("*")->where("id in ({$ids})")->select(); + + $hav_special = 0; + $hav_common = 0; + foreach ($dbres as $key => $value) { + if ($value['withdraw_type'] == 3) { + $hav_special = 1; + } else { + $hav_common = 1; + } + } + + if ($hav_special && $hav_common) { + $this->error("特殊补点不能与正常结算一起汇总"); + } + //分单 $basedata = [ "pay_amount"=>0, @@ -152,7 +168,7 @@ class CompanyStatementLackController extends ThinkController "verify_status"=>0, "verify_log"=>json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y.m.d H:i:s")]), "op_time"=>time(), - "company_list"=>[] + "company_list"=>[], ]; $datas = ["ups","up","downs","down","user","users"]; //初始化数据 @@ -269,6 +285,7 @@ class CompanyStatementLackController extends ThinkController } protected function addStatementInfo($va,$ke,&$v,$k){ + if($k=="ups" || $k=='downs' || $k =="users"){ $verify_status = 0; }else{ @@ -294,8 +311,10 @@ class CompanyStatementLackController extends ThinkController "statement_end_time"=>$v['statement_end_time'], "statement_info"=>json_encode($va['statement_info'],JSON_UNESCAPED_UNICODE), "statement_num"=>$va['statement_num'], - "verify_status"=>$verify_status + "verify_status"=>$verify_status, + "withdraw_type"=>$va['withdraw_type'] ]; + $companyid = $StatementInfo->add($company); $v['info_ids'][] =$companyid; $v['statement_money'] +=$va['statement_money']; @@ -337,7 +356,8 @@ class CompanyStatementLackController extends ThinkController "fine"=>$fine, "reward"=>$reward, "statement_info"=>$v['statement_info'], - "statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5) + "statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5), + "withdraw_type"=>$v['withdraw_type'], ]; $savedata['company_list'][$v['company_id']] = $tdata; } diff --git a/Application/Admin/View/CompanyStatement/lists.html b/Application/Admin/View/CompanyStatement/lists.html index efbb76f37..8147dc3f2 100644 --- a/Application/Admin/View/CompanyStatement/lists.html +++ b/Application/Admin/View/CompanyStatement/lists.html @@ -222,7 +222,7 @@ - + {$data.company_name} {$data.company_belong} {$data.valid} @@ -478,9 +478,9 @@ var opst ="[审批通过]"; var status = [1]; }else if(id=="updateStatement"){ - var opname = "重算金额(特殊补点无法重算)"; + var opname = "重算金额"; var opurl = "{:U('updateStatement')}"; - var opst ="[汇总撤销,管理员审批拒绝,未进行审批,管理员审批通过]"; + var opst ="[汇总撤销,管理员审批拒绝,未进行审批,管理员审批通过,非特殊补点]"; var status = [-3,-2,-1,0,1]; var confirm = true; }else if(id=="delStatement"){ @@ -493,7 +493,8 @@ var confirm = confirm ? confirm :false; var flag = false; var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { - if($.inArray( $(elem).data("status"),status) == -1){ + + if($.inArray( $(elem).data("status"),status) == -1||(id=="updateStatement" && $(elem).data("type")==3)){ flag = true; }else{ return $(elem).val(); diff --git a/Application/Admin/View/CompanyStatementLack/lists.html b/Application/Admin/View/CompanyStatementLack/lists.html index 83f332070..21152b647 100644 --- a/Application/Admin/View/CompanyStatementLack/lists.html +++ b/Application/Admin/View/CompanyStatementLack/lists.html @@ -158,6 +158,7 @@ 合作公司 公司类型 + 结算类型 结算时间 打款流程 结算金额 @@ -180,6 +181,7 @@ {$data.company_name} {$data.company_type_str} + {$data.withdraw_type_str} {$data.valid} {$data.is_payment_str}