Merge pull request 'feature/add_item' (#275) from feature/add_item into release

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/275
master
郑永星 4 years ago
commit 80fe58ee20

@ -2119,7 +2119,7 @@ class CompanyStatementController extends ThinkController
$handleData[$_REQUEST['company_id']]['company_name'] = $companyData['company_name'];
$handleData[$_REQUEST['company_id']]['begin_time'][] = $value['end_time'] + 1;
$handleData[$_REQUEST['company_id']]['end_time'][] = strtotime(I('time_end'))-86399;
$handleData[$_REQUEST['company_id']]['end_time'][] = strtotime(I('time_end'))+86399;
$handleData[$_REQUEST['company_id']]['relation_game_id'][] = $value['relation_game_id'];
$handleData[$_REQUEST['company_id']]['relation_game_name'][] = $value['relation_game_name'];
$handleData[$_REQUEST['company_id']]['ratio'][] = $handleRadioMould[$value['relation_game_id']]['ratio']?$handleRadioMould[$value['relation_game_id']]['ratio']:0;

@ -380,12 +380,15 @@ class CompanyStatementSetController extends Controller {
"company_type"=>1,
"company_id"=>$add_data['company_id'],
"settlement_type"=>2,
"is_verify"=>1,
);
$rfres = M("RewardDetail","tab_")
->field("
IFNULL(SUM(CASE WHEN type = 1 THEN amount ELSE 0 END),0) as reward_count,
IFNULL(SUM(CASE WHEN type = 2 THEN amount ELSE 0 END),0) as fine_count
")
->join('tab_reward_record as r on d.record_id = r.id', 'LEFT')
->where($rrmap)->find();
if($rfres['reward_count'] > 0){
$reward_count = $rfres['reward_count'];
@ -892,12 +895,14 @@ class CompanyStatementSetController extends Controller {
"company_type"=>2,
"company_id"=>$add_data['company_id'],
"settlement_type"=>2,
"is_verify"=>1,
);
$rfres = M("RewardDetail","tab_")
->field("
IFNULL(SUM(CASE WHEN type = 1 THEN amount ELSE 0 END),0) as reward_count,
IFNULL(SUM(CASE WHEN type = 2 THEN amount ELSE 0 END),0) as fine_count
")
->join('tab_reward_record as r on d.record_id = r.id', 'LEFT')
->where($rrmap)->find();
if($rfres['reward_count'] > 0){
$reward_count = $rfres['reward_count'];
@ -2098,6 +2103,7 @@ class CompanyStatementSetController extends Controller {
"d.company_type"=>2,
"d.company_id"=>$cpmpamy_id,
"d.settlement_type"=>2,
"is_verify"=>1,
// "relation_game_id"=>$relation_game_id,
);
@ -2146,6 +2152,7 @@ class CompanyStatementSetController extends Controller {
"d.company_type"=>1,
"d.company_id"=>$cpmpamy_id,
"d.settlement_type"=>2,
"is_verify"=>1,
// "relation_game_id"=>$relation_game_id,
);
@ -2177,12 +2184,14 @@ class CompanyStatementSetController extends Controller {
"d.company_type"=>2,
"d.company_id"=>$cpmpamy_id,
"d.settlement_type"=>2,
"is_verify"=>1,
);
$rfres = M("RewardDetail","tab_")
->alias("d")
->field("
IFNULL(SUM(CASE WHEN type = 1 THEN amount ELSE 0 END),0) as reward,
IFNULL(SUM(CASE WHEN type = 2 THEN amount ELSE 0 END),0) as fine")
->join('tab_reward_record as r on d.record_id = r.id', 'LEFT')
->where($rrmap)
->group("company_id")
->find();

@ -294,7 +294,7 @@ class FinancePromoteController extends AdminController
}
$map['s.pay_status']=1;
$map['s.is_check']=2;
$field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
$field= "SUM(CASE WHEN pay_way >= 0 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,
SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as bind_coin_count,
IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',s.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) p_id,

@ -228,6 +228,11 @@ class GameController extends ThinkController
->field("real_name")
->where(['uid' => I('post.game_belong_id')])
->find()['real_name'];
if(!$realname) {
$realname = '';
}
$_POST['game_belong_name'] =$realname;
$game = D(self::model_name);//M('$this->$model_name','tab_');
@ -427,6 +432,11 @@ ADD COLUMN `kefu_qq` varchar(255) NULL DEFAULT '' COMMENT 'kefu_qq_type为2 时
->field("real_name")
->where(['uid' => I('post.game_belong_id')])
->find()['real_name'];
if(!$realname) {
$realname = '';
}
$_POST['game_belong_name'] =$realname;

@ -757,12 +757,18 @@ class MarketPercentageController extends ThinkController
continue;
}
}
// if ($value['admin_id'] == 27) {
// dump($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']));
// }
// dump($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']));
//离职结算判断
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['performance_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['achievement_bonus']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($value['wait_performance_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($value['wait_achievement_commission']='0.00'):'';
if ($this->unSettlementList[$value['admin_id']]&&date("Y-m",$this->unSettlementList[$value['admin_id']])<=$value['pay_time']) {
$data[$key]['leave_time'] = date("Y-m-d",$this->unSettlementList[$value['admin_id']]);
}
@ -834,6 +840,9 @@ class MarketPercentageController extends ThinkController
$data[$key]['extend_commission'] = number_format($data[$key]['extend_commission'], 2, '.', '');
$data[$key]['should_month_bonus_ratio'] = $data[$key]['extend_commission'] - $data[$key]['should_performance_commission'];
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['should_performance_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['should_month_bonus_ratio']='0.00'):'';
// dump($this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission']);
// dump($this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['achievement_bonus']);
@ -842,11 +851,19 @@ class MarketPercentageController extends ThinkController
$data[$key]['wait_commission'] = number_format($data[$key]['wait_commission'], 2, '.', '');
$data[$key]['wait_achievement_commission'] = $data[$key]['wait_commission'] - $data[$key]['wait_performance_commission'];
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_achievement_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_performance_commission']='0.00'):'';
$data[$key]['achievement_bonus'] = $achievement_bonus;
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['commission']-=$data[$key]['wait_commission']):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_performance_commission']='0.00'):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_achievement_commission']='0.00'):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_commission']='0.00'):'';
$sum['performance_revenue'] += $data[$key]['performance_revenue'];
$sum['appraisal_bonuses'] += $data[$key]['appraisal_bonuses'];
$sum['performance_commission'] += $data[$key]['performance_commission'];
@ -862,7 +879,7 @@ class MarketPercentageController extends ThinkController
// $sum['wait_achievement_commission'] += $data[$key]['wait_achievement_commission'];
}
// die();
$sum['wait_commission'] = '-------';
$sum['pay_time'] = '总计';
@ -929,34 +946,6 @@ class MarketPercentageController extends ThinkController
$data[$key]['achievement_bonus'] .= ',2)';
}
// if ($value['achievement_profit'] != "0.00") {
// if ($data[$key]['performance_commission'] == "=ROUND(") {
// $data[$key]['performance_commission'] .= "K{$line}*(G{$line}/100),2)";
// } else {
// $data[$key]['performance_commission'] .= "+K{$line}*(G{$line}/100),2)";
// }
//
// if ($data[$key]['achievement_bonus'] == "=ROUND(") {
// $data[$key]['achievement_bonus'] .= "K{$line}*(I{$line}/100),2)";
// } else {
// $data[$key]['achievement_bonus'] .= "+K{$line}*(I{$line}/100),2)";
// }
// } else {
// $data[$key]['performance_commission'] .= ",2)";
// $data[$key]['achievement_bonus'] .= ",2)";
// }
//
// if ($data[$key]['performance_commission'] == '=ROUND(,2)') {
// $data[$key]['performance_commission'] = "0.00";
// }
//
// if ($data[$key]['achievement_bonus'] == '=ROUND(,2)') {
// $data[$key]['achievement_bonus'] = "0.00";
// }
// $data[$key]['performance_commission'] = "=ROUND(J{$line}*(F{$line}/100)+J{$line}*(G{$line}/100),2)";
// $data[$key]['achievement_bonus'] = "=ROUND(J{$line}*(H{$line}/100)+J{$line}*(I{$line}/100),2)";
$data[$key]['commission'] = "=ROUND(L{$line}+M{$line}*N{$line},2)";
}
@ -1130,6 +1119,7 @@ class MarketPercentageController extends ThinkController
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['performance_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['achievement_bonus']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($value['wait_performance_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($value['wait_achievement_commission']='0.00'):'';
@ -1146,6 +1136,15 @@ class MarketPercentageController extends ThinkController
$data[$key]['commission'] = number_format($data[$key]['performance_commission'] + $data[$key]['achievement_bonus'], 2, '.', '');;
$data[$key]['extend_commission'] = $data[$key]['commission'] - $data[$key]['wait_commission'];
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['commission']-=$data[$key]['wait_commission']):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_performance_commission']='0.00'):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_achievement_commission']='0.00'):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_commission']='0.00'):'';
$sum['performance_revenue'] += $value['performance_revenue'];
$sum['appraisal_bonuses'] += $value['appraisal_bonuses'];

@ -346,7 +346,7 @@ class StatementMangementController extends ThinkController
$list = SM('reward_record', 'tab_')->alias('r')
->field('
r.id, r.relation_game_id, r.settlement_time, r.confirm_time, r.content, r.reward_type, r.creater_id,
r.id, r.relation_game_id, r.settlement_time, r.confirm_time, r.content, r.reward_type, r.creater_id,is_verify,verify_detail,
rd.id as rid, rd.type as detail_type, rd.company_type as detail_company_type, rd.company_id as detail_company_id , rd.company_name as detail_company_name, rd.settlement_type as detail_settlement_type, rd.promote_account as detail_promote_account,rd.amount as detail_amount
')
->where($map)
@ -356,6 +356,15 @@ class StatementMangementController extends ThinkController
if ($list) {
$record = [];
foreach ($list as $item) {
$item["verify_detail"] = json_decode($item["verify_detail"],true);
if($item["is_verify"] == 0) {
$verify_detail = "未审核";
} elseif($item["is_verify"] == 1) {
$verify_detail="审核通过<br>"."(".$item["verify_detail"]["user"].")<br>".$item["verify_detail"]["time"];
} else{
$verify_detail="审核拒绝<br>"."(".$item["verify_detail"]["user"].")<br>".$item["verify_detail"]["time"];
}
if (!isset($record[$item['id']]))
{
@ -370,7 +379,9 @@ class StatementMangementController extends ThinkController
'maxCount' => 0,
'creater_id' => $item['creater_id'],
'totalReward' => 0,
'totalPunish' => 0
'totalPunish' => 0,
'is_verify'=>$item['is_verify'],
'verify'=>$verify_detail
];
}
if (!empty($item['rid'])) {
@ -558,6 +569,8 @@ class StatementMangementController extends ThinkController
$ins = SM('reward_record', 'tab_')->add($data);
$record_id = SM('reward_record', 'tab_')->getLastInsID();
$this->autoVerify($settlmentSet,$record_id);
foreach ($settlmentSet as $item) {
$item['record_id'] = $record_id;
SM('reward_detail', 'tab_')->add($item);
@ -1474,4 +1487,89 @@ class StatementMangementController extends ThinkController
}
//审核
public function verify() {
$id = $_REQUEST["id"];
$status = $_REQUEST["status"];
if (!isset($id)||!isset($status)) {
$this->ajaxReturn(["status"=>0,"msg"=>"参数错误"]);
}
if($status != 2) {
$data = SM("reward_record","tab_")
->field("is_verify,company_id,company_belong")
->join("left join tab_reward_detail on record_id=tab_reward_record.id")
->join("left join tab_promote_company on tab_promote_company.id=tab_reward_detail.company_id")
->where(["tab_reward_record.id"=>['in',$id]])
->select();
foreach ($data as $key => $value) {
if ($value['is_verify'] != 0) {
$this->ajaxReturn(["status"=>0,"msg"=>"含有已审核无需重新审核"]);
}
}
$detail = json_encode(["user"=>$_SESSION['onethink_admin']['user_auth']['username'],"time"=>date("Y-m-d H:i:s",time())]);
$is_success = SM("reward_record","tab_")->where(["id"=>['in',$id]])->save(["is_verify"=>$status,"verify_detail"=>$detail]);
if ($is_success) {
$this->ajaxReturn(["status"=>1,"msg"=>"操作成功"]);
} else {
$this->ajaxReturn(["status"=>1,"msg"=>"操作失败"]);
}
} else {
$data = SM("reward_record","tab_")
->field("is_verify,company_id,company_belong")
->join("left join tab_reward_detail on record_id=tab_reward_record.id")
->join("left join tab_promote_company on tab_promote_company.id=tab_reward_detail.company_id")
->where(["tab_reward_record.id"=>['in',$id]])
->select();
foreach ($data as $key => $value) {
if ($value['is_verify'] == 0) {
$this->ajaxReturn(["status"=>0,"msg"=>"含有未审核无需撤回审核"]);
}
}
$is_success = SM("reward_record","tab_")->where(["id"=>['in',$id]])->save(["is_verify"=>0,"verify_detail"=>'']);
if ($is_success) {
$this->ajaxReturn(["status"=>1,"msg"=>"操作成功"]);
} else {
$this->ajaxReturn(["status"=>1,"msg"=>"操作失败"]);
}
}
}
//自动审核通过
public function autoVerify($settlmentSet = [],$id = 0) {
if (!$id) {
return false;
}
$i = 0;
$count = count($settlmentSet);
foreach ($settlmentSet as $key => $value) {
if ($value['company_id']) {
$data = SM("promote_company","tab_")->where(["id"=>$value['company_id']])->find();
if (in_array($data["company_belong"],[0,3])) {
$i++;
}
}
}
if ($i == $count) {
$detail = json_encode(["user"=>$_SESSION['onethink_admin']['user_auth']['username'],"time"=>date("Y-m-d H:i:s",time())]);
SM("reward_record","tab_")->where(["id"=>['in',$id]])->save(["is_verify"=>1,"verify_detail"=>$detail]);
}
}
}

@ -391,6 +391,19 @@
// });
// })
$(".refund,.withhold").keyup(function() {
var val = $(this).val();
var reg = /^(\-|\+)?\d+(\.\d+)?$/g;
if (val == '-') {
return;
}
if( !reg.test(val)){
$(this).val(0)
}
});
var pool_ids = "{$_GET['id']}";
$(".split_RewardOrFail").on("click",function() {
@ -535,12 +548,24 @@
});
$(".refund").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".withhold").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
@ -576,7 +601,7 @@
}
//退款
var refund = $(_this).parent().parent().find(".refund").val();
if (!refund || refund < 0) {
if (!refund) {
refund = 0;
$(_this).parent().parent().find(".refund").val(refund);
} else if(parseFloat(refund) > parseFloat(pay_money)) {

@ -138,7 +138,7 @@
<td><span class="pay_amount">{$com['statement_info'][0]['pay_amount']}</span></td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<input class="refund" value="{$com['statement_info'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<else/>
0
</if>
@ -172,8 +172,8 @@
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['reward']-0}</td>
<td rowspan="{$com['statement_info'][0]['row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;display: none">
<input class="withhold" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<input class="oldwithhold" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
@ -226,7 +226,7 @@
<td><span class="pay_amount">{$it['pay_amount']}</span></td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<input class="refund" value="{$it['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<else/>
0
</if>
@ -261,8 +261,8 @@
<td rowspan="{$it['row']}">{$it['reward']-0}</td>
<td rowspan="{$it['row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['withhold']|default=0}" style="width: 40px;display: none">
<input class="withhold" value="{$it['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<input class="oldwithhold" value="{$it['withhold']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
@ -361,6 +361,20 @@
});
});
</if>
$(".refund,.withhold").keyup(function() {
var val = $(this).val();
var reg = /^(\-|\+)?\d+(\.\d+)?$/g;
if (val == '-') {
return;
}
if( !reg.test(val)){
$(this).val(0)
}
});
// $(".no_statement").on("click",function(){
// var id = $(this).data('id');
// $.ajax({
@ -528,12 +542,24 @@
});
$(".refund").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".withhold").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
@ -569,7 +595,7 @@
}
//退款
var refund = $(_this).parent().parent().find(".refund").val();
if (!refund || refund < 0) {
if (!refund) {
refund = 0;
$(_this).parent().parent().find(".refund").val(refund);
} else if(parseFloat(refund) > parseFloat(pay_money)) {

@ -197,8 +197,8 @@
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['game_list'][0]['fine']||default="0"}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;display: none" >
<input class="withhold" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;display: none" >
<else/>
0
</if>
@ -343,8 +343,8 @@
<notempty name="account['time']">
<td rowspan="{$account['time_row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']}{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
<input class="withhold" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']}{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
@ -464,9 +464,14 @@
saveForm(id);
});
$(".refund").keyup(function() {
$(".refund,.withhold").keyup(function() {
var val = $(this).val();
var reg = /^(\-|\+)?\d+(\.\d+)?$/g;
if (val == '-') {
return;
}
if( !reg.test(val)){
$(this).val(0)
}
@ -610,12 +615,24 @@
});
$(".refund").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".withhold").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();

@ -168,7 +168,7 @@
<td><span class="pay_amount">{$com['statement_info'][0]['game_list'][0]['pay_amount']}</span></td>
<td>
<!-- {$com['statement_info'][0]['game_list'][0]['refund']|default=0}-->
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]">
<input class="refund" value="{$com['statement_info'][0]['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]">
</td>
<td>{$com['statement_info'][0]['game_list'][0]['ratio']}%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$com['statement_info'][0]['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
@ -179,8 +179,8 @@
<td rowspan="{$com.row}">{$com['fine']}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">
<!-- {$com['statement_info'][0]['game_list'][0]['withhold']|default=0}-->
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;display: none" >
<input class="withhold" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;display: none" >
</td>
<td rowspan="{$com['statement_info'][0]['time_row']}"><span class="week_amount">{$com['statement_info'][0]['week_amount']}</span><input style="display: none" class="week_amount_input" value="{$com['statement_info'][0]['week_amount']}"></td>
<td rowspan="{$com.row}" data-st="{$com['st']}" class="statement_money">{$com['statement_money']}</td>
@ -233,7 +233,7 @@
<td>{$game['game_type_name']}</td>
<!-- <td>{$game['statement_begin_time']}-{$game['statement_end_time']}</td>-->
<td><span class="pay_amount">{$game['pay_amount']}</span></td>
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]"></td>
<td><input class="refund" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]"></td>
<td>{$game['ratio']}%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
<td><span class="sum_money_span">{$game['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$game['sum_money']}" style="width: 20px;display: none">
@ -264,7 +264,7 @@
<td><span class="pay_amount">{$account['game_list'][0]['pay_amount']}</span></td>
<!-- <td>{$account['game_list'][0]['ratio']|showNumPercent}</td>-->
<!-- <td>{$account['game_list'][0]['increment_ratio']|showNumPercent}</td>-->
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]"></td>
<td><input class="refund" value="{$account['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]"></td>
<td>{$account['game_list'][0]['ratio']}%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$account['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
<td>
@ -280,8 +280,8 @@
<notempty name="account['time']">
<td rowspan="{$account['time_row']}">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']}{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
<input class="withhold" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']}{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
</td>
<td rowspan="{$account['time_row']}"><span class="week_amount">{$account['week_amount']}</span><input style="display: none" class="week_amount_input" value="{$account['week_amount']}"></td>
</notempty>
@ -309,7 +309,7 @@
<td><span class="pay_amount">{$game['pay_amount']}</span></td>
<!-- <td>{$game['ratio']|showNumPercent}</td>-->
<!-- <td>{$game['increment_ratio']|showNumPercent}</td>-->
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]"></td>
<td><input class="refund" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]"></td>
<td>{$game['ratio']}%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
<td>
@ -374,6 +374,20 @@
});
});
</if>
$(".refund,.withhold").keyup(function() {
var val = $(this).val();
var reg = /^(\-|\+)?\d+(\.\d+)?$/g;
if (val == '-') {
return;
}
if( !reg.test(val)){
$(this).val(0)
}
});
$(".no_statement").on("click",function(){
var id = $(this).data('id');
saveForm(id);
@ -461,12 +475,24 @@
});
$(".refund").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".withhold").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
@ -499,7 +525,7 @@
}
//退款
var refund = $(_this).parent().parent().find(".refund").val();
if (!refund || refund < 0) {
if (!refund) {
refund = 0;
$(_this).parent().parent().find(".refund").val(refund);
} else if(parseFloat(refund) > parseFloat(pay_money)) {

@ -166,6 +166,11 @@
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class='butn verify' data-status="1" style='background-color: #3C95C8;'>审核通过</a>
<a class='butn verify' data-status="-1" style='background-color: red;'>审核拒绝</a>
<a class='butn verify' data-status="2" style='background-color: #3C95C8;'>审核撤回</a>
<if condition="$IS_SUBSITE eq true">
<a class='butn' id='coefficient_in_check' href="{:U('addreward')}" style='background-color: #3C95C8;'>奖惩导入</a>
</if>
@ -179,6 +184,7 @@
<!-- 表头 -->
<thead>
<tr>
<th><input class="check-all" type="checkbox"></th>
<th style="width: 100px;">游戏名</th>
<th style="width: 100px;">游戏合作方</th>
<th >结算时间</th>
@ -202,6 +208,7 @@
<th>结算方式</th>
<th>添加人</th>
<th>审核状态</th>
<th>操作</th>
</tr>
</thead>
@ -218,6 +225,7 @@
<!-- 如果没有子级 -->
<?php if(!$data['maxCount']):?>
<tr>
<td ><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td>{$data['relation_game_name']}</td>
<td>{$data['relation_game_partner']}</td>
<td>{$data['settlement_time']}</td>
@ -239,10 +247,20 @@
<td></td>
<td>{:get_admin_name($data['creater_id'])}</td>
<if condition="$data.is_verify eq 1">
<td>{$data.verify}</td>
<elseif condition="$data.is_verify eq -1"/>
<td style="color:red;">{$data.verify}</td>
<else/>
<td>--</td>
</if>
<td>
<a href="{:U('StatementMangement/rewardManageDetail',array('id'=>$data['id']))}">查看 </a>
<if condition="$data.is_verify neq 1">
<a href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id']))}">编辑 </a>
<a class="confirm ajax-get" href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id'], 'delete'=>1))}">删除 </a>
</if>
</td>
</tr>
<!-- 如果有子级 -->
@ -250,6 +268,7 @@
<?php for($i=0; $i<$data['maxCount']; $i++):?>
<?php if($i == 0):?>
<tr>
<td rowspan="{$data['maxCount']}"><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td rowspan="{$data['maxCount']}">{$data['relation_game_name']}</td>
<td rowspan="{$data['maxCount']}">{$data['relation_game_partner']}</td>
<td rowspan="{$data['maxCount']}">{$data['settlement_time']}</td>
@ -271,10 +290,19 @@
<td><?=$data['detail'][1][$i]['settlement_type_text'] ?? '无'?></td>
<td rowspan="{$data['maxCount']}">{:get_admin_name($data['creater_id'])}</td>
<if condition="$data.is_verify eq 1">
<td rowspan="{$data['maxCount']}">{$data.verify}</td>
<elseif condition="$data.is_verify eq -1"/>
<td style="color:red;" rowspan="{$data['maxCount']}">{$data.verify}</td>
<else/>
<td rowspan="{$data['maxCount']}">--</td>
</if>
<td rowspan="{$data['maxCount']}">
<a style="padding: 0px;" href="{:U('StatementMangement/rewardManageDetail',array('id'=>$data['id']))}">查看 </a>
<if condition="$data.is_verify neq 1">
<a style="padding: 0px;" href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id']))}">编辑 </a>
<a style="padding: 0px;" class="confirm ajax-get" href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id'], 'delete'=>1))}">删除 </a>
</if>
</td>
</tr>
<?php else:?>
@ -357,6 +385,33 @@
,range: '~'
});
$(".verify").click(function(){
var status = $(this).data("status");
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get();
$.ajax({
url:"{:U('verify')}",
type:"post",
data:{
status:status,
id:text
},
dataType:'json',
success:function(data){
layer.msg("<font style='color: white'>"+data.msg+"</font>");
if (data.status == 1) {
setTimeout(function () {
window.location.reload();
},1000)
}
}
})
});
// var partner_id = {:I('partner_id', 0)};
// function get_company_list()
// {

@ -82,6 +82,37 @@ class LeavePercentageFactory
}
/**
* 判断是否结算绩效
* @param string $date
* @param int $admin_id
* @return bool
*/
public function isTimeoutSettlement($date = '',$admin_id= 0) {
//未离职结算
if (!isset(self::$arrUnSettlementList[$admin_id])) {
return true;
}
//判断往后日期都不结算
if (self::$arrUnSettlementList[$admin_id]
&&date("Y-m",self::$arrUnSettlementList[$admin_id])!=$date
&&strtotime($date)>self::$arrUnSettlementList[$admin_id]) {
return false;
}
//当月离职时间在职时间小于30天不结算
if (self::$arrUnSettlementList[$admin_id]
&&date("Y-m",self::$arrUnSettlementList[$admin_id])==$date
&&(self::$arrUnSettlementList[$admin_id]-self::$arrUnSettlementApplyList[$admin_id])>=86400*30) {
return false;
}
return true;
}
/**
* 离职定时器方法
*/

Loading…
Cancel
Save