|
|
|
@ -270,9 +270,18 @@ class AjaxController extends ThinkController{
|
|
|
|
|
|
|
|
|
|
$statementData = json_decode($getStatementData['statement_info'],true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$reward = 0;
|
|
|
|
|
$forfeit = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($statementData) {
|
|
|
|
|
$data['sum'] = $getStatementData['statement_money'];
|
|
|
|
|
$data['pay_amount'] = $getStatementData['pay_amount'];
|
|
|
|
|
|
|
|
|
|
$data['reward'] = 0;
|
|
|
|
|
$data['forfeit'] = 0;
|
|
|
|
|
|
|
|
|
|
$handleStatementData = [];
|
|
|
|
|
foreach ($statementData as $key=>$sv) {
|
|
|
|
|
if ($sv['game_id']) {
|
|
|
|
@ -287,9 +296,15 @@ class AjaxController extends ThinkController{
|
|
|
|
|
|
|
|
|
|
$handleStatementData[$sv['game_id']][] = $nowVal;
|
|
|
|
|
} else {
|
|
|
|
|
$data['forfeit'] = $sv['sum_money'];
|
|
|
|
|
if ($sv['statement_type'] == 2) {
|
|
|
|
|
$data['reward'] += $sv['sum_money'];
|
|
|
|
|
} else if ($sv['statement_type'] == 1) {
|
|
|
|
|
$data['forfeit'] += $sv['sum_money'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// dump($handleStatementData);die();
|
|
|
|
|
$first_party_info = json_decode($getStatementData['first_party_info'],true);
|
|
|
|
|
$second_party_info = json_decode($getStatementData['second_party_info'],true);
|
|
|
|
|
$data['game_ratio'] = $handleStatementData;
|
|
|
|
@ -358,6 +373,32 @@ class AjaxController extends ThinkController{
|
|
|
|
|
|
|
|
|
|
foreach ($value as $k => &$v) {
|
|
|
|
|
|
|
|
|
|
$startTime = strtotime($v['begin_time']);
|
|
|
|
|
$endTime = strtotime($v['end_time']);
|
|
|
|
|
|
|
|
|
|
$rewardData = M('reward_record','tab_')
|
|
|
|
|
->field("sum(tab_reward_record.money) as money,reward_type")
|
|
|
|
|
->join("left join (select * from tab_game group by relation_game_id)tab_game on tab_reward_record.relation_game_id=tab_game.relation_game_id")
|
|
|
|
|
->where(['company_type'=>2,'relation_game_name'=>['like',"%{$v['game_name']}%"],'company_id'=>$data['company_id'],'reward_time'=>['between',[$startTime,$endTime]]])
|
|
|
|
|
->group('reward_type')
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
foreach ($rewardData as $key => $valReward) {
|
|
|
|
|
|
|
|
|
|
if ($valReward['reward_type']==1) {
|
|
|
|
|
|
|
|
|
|
$reward = $reward + $valReward['money'];
|
|
|
|
|
|
|
|
|
|
} else if ($valReward['reward_type']==2) {
|
|
|
|
|
|
|
|
|
|
$forfeit = $forfeit + $valReward['money'];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// dump($reward);die();
|
|
|
|
|
|
|
|
|
|
if ($game_ratio[$v['game_name']]) {
|
|
|
|
|
|
|
|
|
|
$v['sum_amount'] = number_format($v['sum_amount'] + $game_ratio[$v['game_name']]['sum_amount'],2,'.','');
|
|
|
|
@ -370,6 +411,9 @@ class AjaxController extends ThinkController{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data['reward'] = $reward;
|
|
|
|
|
$data['forfeit'] = $forfeit;
|
|
|
|
|
|
|
|
|
|
$yfData = M('tool','tab_')->where(['name'=>'company_info'])->find();
|
|
|
|
|
$yfData = json_decode($yfData['config'],true);
|
|
|
|
|
|
|
|
|
|