From a48f0214c7ccb10b9e9f65d2554287b96b91b903 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Fri, 2 Apr 2021 17:23:35 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=BD=92=E5=B1=9E=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/GameController.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Application/Admin/Controller/GameController.class.php b/Application/Admin/Controller/GameController.class.php index 9ac6db3fb..b4a37a725 100644 --- a/Application/Admin/Controller/GameController.class.php +++ b/Application/Admin/Controller/GameController.class.php @@ -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; From 65e0fda02f588b62678dc1461ff0d13e193d1b97 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Tue, 6 Apr 2021 11:41:24 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=B7=A5=E4=BC=9A=E7=BB=9F=E8=AE=A1bug?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/FinancePromoteController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 0c7ab2198..cafcd7fc6 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -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, From 72077477ed30b0fc179a3cfe651161ab3815408c Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 12 Apr 2021 14:22:03 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E8=A1=A5=E7=82=B9bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/CompanyStatementController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index e4fe83fea..157866490 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -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; From 9080d521fda55527f2a1886f626ab144ef8fa5e8 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 15 Apr 2021 09:41:24 +0800 Subject: [PATCH 4/4] =?UTF-8?q?4.22=E5=8F=B7=E5=8A=9F=E8=83=BD=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatementSetController.class.php | 9 ++ .../MarketPercentageController.class.php | 59 +++++----- .../StatementMangementController.class.php | 104 +++++++++++++++++- .../View/CompanyStatementPool/editCpPool.html | 27 ++++- .../View/CompanyStatementPool/editPcPool.html | 40 +++++-- .../View/CompanyStatementPool/editPuPool.html | 27 ++++- .../editSpecialPuPool.html | 44 ++++++-- .../StatementMangement/rewardManageList.html | 63 ++++++++++- .../Factory/LeavePercentageFactory.class.php | 31 ++++++ 9 files changed, 345 insertions(+), 59 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementSetController.class.php b/Application/Admin/Controller/CompanyStatementSetController.class.php index ecd82bd39..02e956cf5 100644 --- a/Application/Admin/Controller/CompanyStatementSetController.class.php +++ b/Application/Admin/Controller/CompanyStatementSetController.class.php @@ -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(); diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index 0c161cba5..3d5f54ea1 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -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']; diff --git a/Application/Admin/Controller/StatementMangementController.class.php b/Application/Admin/Controller/StatementMangementController.class.php index 8f3f7cfe4..94b398ad2 100644 --- a/Application/Admin/Controller/StatementMangementController.class.php +++ b/Application/Admin/Controller/StatementMangementController.class.php @@ -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,7 +356,16 @@ 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="审核通过
"."(".$item["verify_detail"]["user"].")
".$item["verify_detail"]["time"]; + } else{ + $verify_detail="审核拒绝
"."(".$item["verify_detail"]["user"].")
".$item["verify_detail"]["time"]; + } + if (!isset($record[$item['id']])) { $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]); + } + } + } diff --git a/Application/Admin/View/CompanyStatementPool/editCpPool.html b/Application/Admin/View/CompanyStatementPool/editCpPool.html index 70b8c583b..793964a52 100644 --- a/Application/Admin/View/CompanyStatementPool/editCpPool.html +++ b/Application/Admin/View/CompanyStatementPool/editCpPool.html @@ -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)) { diff --git a/Application/Admin/View/CompanyStatementPool/editPcPool.html b/Application/Admin/View/CompanyStatementPool/editPcPool.html index 68ee7b5fc..794556f3b 100644 --- a/Application/Admin/View/CompanyStatementPool/editPcPool.html +++ b/Application/Admin/View/CompanyStatementPool/editPcPool.html @@ -138,7 +138,7 @@ {$com['statement_info'][0]['pay_amount']} - + 0 @@ -172,8 +172,8 @@ {$com['statement_info'][0]['reward']-0} - - + + 0 @@ -226,7 +226,7 @@ {$it['pay_amount']} - + 0 @@ -261,8 +261,8 @@ {$it['reward']-0} - - + + 0 @@ -361,6 +361,20 @@ }); }); + + $(".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)) { diff --git a/Application/Admin/View/CompanyStatementPool/editPuPool.html b/Application/Admin/View/CompanyStatementPool/editPuPool.html index 1f9d4666b..771c82f24 100644 --- a/Application/Admin/View/CompanyStatementPool/editPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/editPuPool.html @@ -197,8 +197,8 @@ {$com['statement_info'][0]['game_list'][0]['fine']||default="0"} - - + + 0 @@ -343,8 +343,8 @@ - - + + 0 @@ -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(); diff --git a/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html b/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html index 63feb87f7..fad0ba3d0 100644 --- a/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html @@ -168,7 +168,7 @@ {$com['statement_info'][0]['game_list'][0]['pay_amount']} - + {$com['statement_info'][0]['game_list'][0]['ratio']}% % @@ -179,8 +179,8 @@ {$com['fine']} - - + + {$com['statement_info'][0]['week_amount']} {$com['statement_money']} @@ -233,7 +233,7 @@ {$game['game_type_name']} {$game['pay_amount']} - + {$game['ratio']}% % {$game['sum_money']} @@ -264,7 +264,7 @@ {$account['game_list'][0]['pay_amount']} - + {$account['game_list'][0]['ratio']}% % @@ -280,8 +280,8 @@ - - + + {$account['week_amount']} @@ -309,7 +309,7 @@ {$game['pay_amount']} - + {$game['ratio']}% % @@ -374,6 +374,20 @@ }); }); + + $(".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)) { diff --git a/Application/Admin/View/StatementMangement/rewardManageList.html b/Application/Admin/View/StatementMangement/rewardManageList.html index 838361b13..8e1e7b1fe 100644 --- a/Application/Admin/View/StatementMangement/rewardManageList.html +++ b/Application/Admin/View/StatementMangement/rewardManageList.html @@ -166,6 +166,11 @@
+ + 审核通过 + 审核拒绝 + + 审核撤回 奖惩导入 @@ -179,6 +184,7 @@ + 游戏名 游戏合作方 结算时间 @@ -202,6 +208,7 @@ 结算方式 添加人 + 审核状态 操作 @@ -218,6 +225,7 @@ + {$data['relation_game_name']} {$data['relation_game_partner']} {$data['settlement_time']} @@ -239,10 +247,20 @@ 无 {:get_admin_name($data['creater_id'])} + + {$data.verify} + + {$data.verify} + + -- + + 查看 - 编辑 - 删除 + + 编辑 + 删除 + @@ -250,6 +268,7 @@ + {$data['relation_game_name']} {$data['relation_game_partner']} {$data['settlement_time']} @@ -271,10 +290,19 @@ {:get_admin_name($data['creater_id'])} + + {$data.verify} + + {$data.verify} + + -- + 查看 - 编辑 - 删除 + + 编辑 + 删除 + @@ -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(""+data.msg+""); + if (data.status == 1) { + setTimeout(function () { + window.location.reload(); + },1000) + } + + } + }) + }); + // var partner_id = {:I('partner_id', 0)}; // function get_company_list() // { diff --git a/Application/Base/Factory/LeavePercentageFactory.class.php b/Application/Base/Factory/LeavePercentageFactory.class.php index ac96ac7d5..1c78c7bc9 100644 --- a/Application/Base/Factory/LeavePercentageFactory.class.php +++ b/Application/Base/Factory/LeavePercentageFactory.class.php @@ -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; + + } + /** * 离职定时器方法 */