Merge pull request '商务奖金功能修改' (#252) from feature/add_item into release

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/252
master
郑永星 4 years ago
commit 9fd18898a1

@ -158,6 +158,8 @@ class BusinessAffairsAwardController extends ThinkController
public function businessAffairsList() {
$check_quarter = ["03","06","09","12"];
$map = [];
$params = I('get.');
@ -181,9 +183,12 @@ class BusinessAffairsAwardController extends ThinkController
}
$data = M("business_affairs_award_pool","tab_")
->where($map)
->page($page, $row)
->select();
->where($map);
if (!$_REQUEST['export']) {
$data->page($page, $row);
}
$data = $data->order("time desc")->select();
foreach ($data as $key => $value) {
@ -201,6 +206,16 @@ class BusinessAffairsAwardController extends ThinkController
}else {
$detail .= "<br>";
}
$data[$key]['total_quarter_bonus_pool'] = $value['quarter_bonus_pool'] * 0.25;
$time = date("m",strtotime($value['time']));
if (!in_array($time,$check_quarter)) {
$data[$key]["quarter_award"] = "0.00";
}
$data[$key]['person_award'] = $data[$key]['quarter_award'] + $value['month_award'];
if ($value['verify_status']) {
$data[$key]['verify_detail'] = $detail.date('Y-m-d H:i:s',$value['verify_time']);
} else {
@ -218,7 +233,8 @@ class BusinessAffairsAwardController extends ThinkController
'ratio' => '抽成比例',
'game_belong_name' => '奖励归属',
'month_bonus_pool' => '本月奖金池总额',
'quarter_bonus_pool' => '本季度累计激励',
'total_quarter_bonus_pool'=>'本季度累计激励',
'quarter_bonus_pool' => '个人发放激励',
'month_award' => '流水个人奖金',
'person_award' => '个人奖金总额',
'verify_detail' => '审批状态'];

@ -1583,7 +1583,7 @@ class TimingController extends AdminController {
$lasttime = [$time2,$time3];
$tempoparyData = M("spend","tab_")
->field("tab_spend.*,from_unixtime(payed_time,'%Y-%m') time,from_unixtime(payed_time,'%Y') year,from_unixtime(payed_time,'%Y-%m') month,relation_game_id,relation_game_name,game_belong_id,game_belong_name")
->field("tab_spend.*,from_unixtime(payed_time,'%Y-%m') time,from_unixtime(payed_time,'%Y') year,from_unixtime(payed_time,'%m') month,relation_game_id,relation_game_name,game_belong_id,game_belong_name")
->join("left join tab_game on tab_game.id=tab_spend.game_id")
->where(['tab_spend.pay_status'=>1,'game_belong_id'=>['neq',0],'pay_way' => ['egt', 0]])
->select(false);
@ -1611,23 +1611,38 @@ class TimingController extends AdminController {
->where(['time'=>$time1])
->find()['pay_amount'];
//判断是不是初次
$is_hav = M("business_affairs_award_pool","tab_")->where("time = {$time2}")->find();
$is_hav = M("business_affairs_award_pool","tab_")->where(['time'=>$time2])->find();
foreach ($data as $key => $value){
$month_bonus_pool = 0;
$quarter_bonus_pool = 0;
echo "{$value['time']},{$value['game_belong_name']},{$value['pay_amount']}\n";
foreach($data as $key => $value) {
$value['month_bonus_pool'] = $this->businessAffairRatio($value['pay_amount']);
$month_bonus_pool += $this->businessAffairRatio($value['pay_amount']);
$value['quarter_bonus_pool'] = $this->businessAffairRatio($value['pay_amount']);
$quarter_bonus_pool = $this->businessAffairRatio($value['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']);
$date = date("Y-m",strtotime($value['year'].'-'.(($value['month']-$i)>0?($value['month']-$i):($value['month']-$i+12))));
dump($date);
$quarter_bonus_pool +=
$this->businessAffairRatio($handleData[$date.$value['game_belong_id'].$value['relation_game_id']]['pay_amount']);
}
}
}
foreach ($data as $key => $value){
echo "{$value['time']},{$value['game_belong_name']},{$value['pay_amount']}\n";
$value['month_bonus_pool'] = $month_bonus_pool;
$value['quarter_bonus_pool'] = $quarter_bonus_pool;
unset($value['year']);
unset($value['month']);

@ -183,6 +183,7 @@
<th>奖金归属人</th>
<th>本月奖金池总额</th>
<th>本季度累计激励</th>
<th>个人发放激励</th>
<th>流水个人奖金</th>
<th>个人奖金总额</th>
<th>审批状态</th>
@ -206,6 +207,7 @@
<td>{$data.ratio|default='--'}</td>
<td>{$data.game_belong_name|default='无'}</td>
<td>{$data.month_bonus_pool|default='0'}</td>
<td>{$data.total_quarter_bonus_pool|default='0'}</td>
<td>{$data.quarter_award|default='0'}</td>
<td>{$data.month_award|default='0'}</td>
<td>{$data.person_award|default='0'}</td>

Loading…
Cancel
Save