Merge branch 'hotfix/payStatistic' of wmtx/platform into master

判定是否录入过修正
master
廖金灵 4 years ago committed by Gogs
commit 5e2c093ea4

@ -1145,23 +1145,40 @@ class CompanyStatementController extends ThinkController
foreach ($check_add as $key => $value) { foreach ($check_add as $key => $value) {
if ($value['statement_end_time'] >= $start_time && $value['statement_end_time']<=$end_time // if ($value['statement_end_time'] >= $start_time && $value['statement_end_time']<=$end_time
||$value['statement_begin_time']>=$start_time && $value['statement_begin_time']<=$end_time // ||$value['statement_begin_time']>=$start_time && $value['statement_begin_time']<=$end_time
||$value['statement_begin_time']>=$start_time && $value['statement_end_time'] <= $end_time) // ||$value['statement_begin_time']<=$start_time && $value['statement_end_time'] >= $end_time)
{ // {
$statementInfo = json_decode($value['statement_info'],true);; $statementInfo = json_decode($value['statement_info'],true);;
if ($value['company_type'] == 2) { if ($value['company_type'] == 2) {
$statementInfo = $statementInfo['game_list'];
}
foreach ($statementInfo as $k => $v) { foreach ($statementInfo as $sk => $sv) {
if (in_array($v['relation_game_id'],$relation_game_data)) { $statementInfos = $sv['game_list'];
$this->ajaxReturn(['status'=>0,'data'=>[],'msg'=>"《{$v['game_name']}》在日期:{$_REQUEST['time_start']}-{$_REQUEST['time_end']}有结算过的部分,请重新选择"]); foreach ($statementInfos as $k => $v) {
if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) {
if (in_array($v['relation_game_id'], $relation_game_data)) {
$this->ajaxReturn(['status' => 0, 'data' => [], 'msg' => "《{$v['game_name']}》在日期:{$_REQUEST['time_start']}-{$_REQUEST['time_end']}有结算过的部分,请重新选择"]);
}
}
}
}
} else {
foreach ($statementInfo as $k => $v) {
if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) {
if (in_array($v['relation_game_id'], $relation_game_data)) {
$this->ajaxReturn(['status' => 0, 'data' => [], 'msg' => "《{$v['game_name']}》在日期:{$_REQUEST['time_start']}-{$_REQUEST['time_end']}有结算过的部分,请重新选择"]);
}
}
} }
} }
}
// }
} }

@ -260,6 +260,7 @@
layer.msg("正在提交请勿重复提交..."); layer.msg("正在提交请勿重复提交...");
return; return;
} }
var is_zero = 0;
layer.load(2); layer.load(2);
is_submit = 0; is_submit = 0;
var time_start = $("#time_start").val(); var time_start = $("#time_start").val();
@ -293,7 +294,11 @@
sec_data['statement_begin_time'] = $(cval).next().find('.begin_time').text(); sec_data['statement_begin_time'] = $(cval).next().find('.begin_time').text();
sec_data['statement_end_time'] = $(cval).next().find('.end_time').text(); sec_data['statement_end_time'] = $(cval).next().find('.end_time').text();
statement_info.push(sec_data); statement_info.push(sec_data);
if (sec_data['increment_ratio']<=0||sec_data['pay_amount']<=0) {
is_zero = 1;
layer.closeAll("loading");
return;
}
var _append = $(cval).parent(); var _append = $(cval).parent();
var row = $(cval).attr('rowspan'); var row = $(cval).attr('rowspan');
for (var i=0;i<row-1;i++) { for (var i=0;i<row-1;i++) {
@ -311,7 +316,12 @@
sec_data['ratio'] = ratio.slice(0, -1); sec_data['ratio'] = ratio.slice(0, -1);
sec_data['increment_ratio'] = parseFloat(_append.find('.relation_game_name').next().next().next().find('input').val()); sec_data['increment_ratio'] = parseFloat(_append.find('.relation_game_name').next().next().next().find('input').val());
if (sec_data['increment_ratio']<=0||sec_data['pay_amount']<=0) {
is_zero = 1;
layer.closeAll("loading");
return;
}
statement_info.push(sec_data); statement_info.push(sec_data);
} }
@ -320,6 +330,12 @@
send.push(data); send.push(data);
}); });
if (is_zero == 1) {
is_submit = 1;
layer.msg("不能提交补点比例为零或者流水为零的数据");
return;
}
if (send.length != 0) { if (send.length != 0) {
$.ajax({ $.ajax({
url: '{:U("addSpecialComplementPost")}', url: '{:U("addSpecialComplementPost")}',
@ -554,18 +570,21 @@
function complementChange() { function complementChange() {
$(".complement").off("change"); $(".complement").off("change");
$('.complement').change(function() { $('.complement').change(function() {
//获取总流水 //获取总流水
var pay_amount = parseFloat($(this).parent().prev().prev().text()); var pay_amount = parseFloat($(this).parent().prev().prev().text());
//计算最终分配比率 //计算最终分配比率
var ratio = parseFloat($(this).val()); var ratio = parseFloat($(this).val());
if (ratio<0) {
$(this).val(0);
ratio = 0;
}
if (ratio>100) { if (ratio>100) {
$(this).val(100); $(this).val(100);
ratio = 100; ratio = 100;
} }
//最终的分配金额 //最终的分配金额
var withdraw_amount = ((pay_amount * ratio)/100).toFixed(2); var withdraw_amount = ((pay_amount * ratio)/100).toFixed(2);

Loading…
Cancel
Save