Merge branch 'hotfix/market_percentage' of wmtx/platform into release

特殊补点与其他汇总重算功能区分添加限制
master
郑永星 4 years ago committed by Gogs
commit 700841fe7f

@ -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; //合作方确认后不进行重算

@ -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;
}

@ -222,7 +222,7 @@
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td ><input class="ids" type="checkbox" data-status="{$data.verify_status}" data-confirm="{$data.confirm_status}" value="{$data['id']}" name="ids[]"></td>
<td ><input class="ids" type="checkbox" data-status="{$data.verify_status}" data-type="{$data.withdraw_type}" data-confirm="{$data.confirm_status}" value="{$data['id']}" name="ids[]"></td>
<td>{$data.company_name}</td>
<td>{$data.company_belong}</td>
<td>{$data.valid}</td>
@ -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();

@ -158,6 +158,7 @@
<th><input class="check-all" type="checkbox"></th>
<th>合作公司</th>
<th>公司类型</th>
<th>结算类型</th>
<th>结算时间</th>
<th>打款流程</th>
<th>结算金额</th>
@ -180,6 +181,7 @@
<td ><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]" data-companytype="{$data['company_type']}"></td>
<td>{$data.company_name}</td>
<td>{$data.company_type_str}</td>
<td>{$data.withdraw_type_str}</td>
<td>{$data.valid}</td>
<td>{$data.is_payment_str}</td>

Loading…
Cancel
Save