|
|
|
@ -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']);
|
|
|
|
|