Merge pull request '财务打款系统bug修复' (#251) from feature/add_item into release

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/251
master
郑永星 4 years ago
commit 5ba38df841

@ -232,10 +232,13 @@ class BusinessAffairsAwardController extends ThinkController
if(IS_ROOT){
$this->assign('verify_check',true);
$this->assign('caculate_check',true);
}else {
$exportRule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_verify_check");
$caculate_check = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_caculate_check");
$this->assign('verify_check', $this->checkRule($exportRule, array('in', '1,2')));
$this->assign('caculate_check', $this->checkRule($caculate_check, array('in', '1,2')));
}
$page = set_pagination($count, $row,$params);
@ -272,12 +275,14 @@ class BusinessAffairsAwardController extends ThinkController
$this->ajaxReturn(['status'=>0,'info'=>'数据错误']);
}
}
public function reCaculate()
{
exec("source /etc/profile;cd " . ROOTTT . ";php " . SUBSITE_INDEX . " timing/setbusinessAffairsAward > /dev/null &");
$this->ajaxReturn(['status' => 1]);
}
}

@ -1563,14 +1563,22 @@ class TimingController extends AdminController {
echo date("Y-m-d H:i:s")."----------------------商务奖金计算----------------------\n";
list($becomeTimeList,$becomeTimeCount) = $this->getAffairList(date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')));
dump($becomeTimeList);
dump($becomeTimeCount);die();
$time1 = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01'));
$time2 = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-02'));
$time3 = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-03'));
if (!$_REQUEST['time']) {
$time = time();
} else {
$time = strtotime($_REQUEST['time']);
$time = strtotime(date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)+1).'-01')));
}
list($becomeTimeList,$becomeTimeCount) = $this->getAffairList(date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-1).'-01')));
$time1 = date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-1).'-01'));
$time2 = date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-2).'-01'));
$time3 = date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-3).'-01'));
$lasttime = [$time2,$time3];
@ -1602,6 +1610,8 @@ class TimingController extends AdminController {
->field("sum(pay_amount) pay_amount")
->where(['time'=>$time1])
->find()['pay_amount'];
//判断是不是初次
$is_hav = M("business_affairs_award_pool","tab_")->where("time = {$time2}")->find();
foreach ($data as $key => $value){
@ -1611,11 +1621,14 @@ class TimingController extends AdminController {
$value['quarter_bonus_pool'] = $this->businessAffairRatio($value['pay_amount']);
for($i = (($value['month']%3)?(($value['month']%3)-1):2); $i == 0; $i--) {
$value['quarter_bonus_pool'] +=
$this->businessAffairRatio($handleData[$value['year'].'-'.(($value['month']-$i)>0?($value['month']-$i):($value['month']-$i+12)).$value['game_belong_id'].$value['relation_game_id']]['pay_amount']);
if ($is_hav) {
for($i = (($value['month']%3)?(($value['month']%3)-1):2); $i > 0; $i--) {
$value['quarter_bonus_pool'] +=
$this->businessAffairRatio($handleData[$value['year'].'-'.(($value['month']-$i)>0?($value['month']-$i):($value['month']-$i+12)).$value['game_belong_id'].$value['relation_game_id']]['pay_amount']);
}
}
unset($value['year']);
unset($value['month']);

@ -102,8 +102,8 @@
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">市场业绩提成</h3>
<p class="description_text">说明:公会统计仅表示符合筛选条件下的数据统计,当搜索所属市场专员时,因为存在换绑等原因,所以不作为市场业绩统计依据</p>
<h3 class="page_title">商务奖金汇总</h3>
<p class="description_text"></p>
</div>
@ -111,6 +111,15 @@
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="fl button_list">
<div class="tools">
<if condition="$caculate_check eq true">
<empty name="show_status">
<a class="recaculate" url="{:U('reCaculate?pay_time='.$_GET['pay_time'])}" style="width: 60px;text-align: center;padding-right: 0;margin-right: 0;">重算</a>
</empty>
</if>
</div>
</div>
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
@ -241,6 +250,35 @@
$(function(){
$('.recaculate').click(function(){
var url = $(this).attr('url');
layer.confirm('是否确认重算商务汇总!', {
title:'重算汇总?',
icon:0,
btn: ['重算','取消'] //按钮
}, function(){
$.ajax({
type: "POST",
url: url,
dataType: 'json',
async: false,
success:function(data){
if(data.status == 1) {
layer.msg("重新计算需要时间,请等待5分钟后再查看");
setTimeout(function(){
window.location.reload();
},1500);
} else {
layer.msg(data.info);
}
},
});
}, function(){
layer.close();
});
});
$(".verify").on("click",function(){

Loading…
Cancel
Save