|
|
@ -1600,6 +1600,10 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$where = [
|
|
|
|
$where = [
|
|
|
|
"_string"=>"first_company_type = '2' OR second_company_type = '2'"
|
|
|
|
"_string"=>"first_company_type = '2' OR second_company_type = '2'"
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//单一公司调试
|
|
|
|
|
|
|
|
// $where['_string'] = "( " . $where['_string'] .") AND ( first_company_id = '509' OR first_company_id = '509' )";
|
|
|
|
|
|
|
|
|
|
|
|
//获取哪些要结算
|
|
|
|
//获取哪些要结算
|
|
|
|
if($type == 1){//月结
|
|
|
|
if($type == 1){//月结
|
|
|
|
$where['settlement_type']=2;
|
|
|
|
$where['settlement_type']=2;
|
|
|
@ -1687,7 +1691,32 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$v['reward'] = 0;
|
|
|
|
$v['reward'] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$v['platform_amount'] = 0;
|
|
|
|
$v['platform_amount'] = 0;
|
|
|
|
if(!isset($v['list'])){continue;}
|
|
|
|
if(!isset($v['list']) && $v['fine'] == 0 && $v['reward'] == 0){continue;}
|
|
|
|
|
|
|
|
if(!array_key_exists('list',$v) && ($v['fine'] > 0 || $v['reward'] > 0)){
|
|
|
|
|
|
|
|
//没有流水,但是有罚款
|
|
|
|
|
|
|
|
$sta_info = [
|
|
|
|
|
|
|
|
"account" => $v['account'],
|
|
|
|
|
|
|
|
"game_list" => [
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
"pay_amount" => 0,
|
|
|
|
|
|
|
|
"relation_game_id" => 0,
|
|
|
|
|
|
|
|
"game_name" => "其他",
|
|
|
|
|
|
|
|
"p_id" => 0,
|
|
|
|
|
|
|
|
"all_pay_amount" => 0,
|
|
|
|
|
|
|
|
"game_type_name" => "其他",
|
|
|
|
|
|
|
|
"ratio"=>0,
|
|
|
|
|
|
|
|
"sum_money" => 0,
|
|
|
|
|
|
|
|
"fax_ratio" => 0,
|
|
|
|
|
|
|
|
"statement_begin_time" => $statement_begin_time,
|
|
|
|
|
|
|
|
"statement_end_time" => $statement_end_time,
|
|
|
|
|
|
|
|
"fine" => $v['fine'],
|
|
|
|
|
|
|
|
"reward" => $v['reward'],
|
|
|
|
|
|
|
|
"statement_type" => 0
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
$v['statement_info'][] = $sta_info;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
$company_belong = $pc[$v['id']]['company_belong'];
|
|
|
|
$company_belong = $pc[$v['id']]['company_belong'];
|
|
|
|
//服务器费用
|
|
|
|
//服务器费用
|
|
|
|
if ($type < 2) {
|
|
|
|
if ($type < 2) {
|
|
|
@ -1712,7 +1741,6 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$templist = $va['game_list'];
|
|
|
|
$templist = $va['game_list'];
|
|
|
|
$va['game_list'] = [];
|
|
|
|
$va['game_list'] = [];
|
|
|
|
foreach ($templist as $p_id => $p_info) {
|
|
|
|
foreach ($templist as $p_id => $p_info) {
|
|
|
|
|
|
|
|
|
|
|
|
$ratioCount = count($promoteCompanyGameRatio[$p_info['relation_game_id']]);
|
|
|
|
$ratioCount = count($promoteCompanyGameRatio[$p_info['relation_game_id']]);
|
|
|
|
$isMoreRatio = $ratioCount > 1 ? true : false;
|
|
|
|
$isMoreRatio = $ratioCount > 1 ? true : false;
|
|
|
|
|
|
|
|
|
|
|
@ -1722,16 +1750,7 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$tratio =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
$tratio =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
$tratio += $company_ratio;
|
|
|
|
$tratio += $company_ratio;
|
|
|
|
} elseif ($type == 0) {
|
|
|
|
} elseif ($type == 0) {
|
|
|
|
// $tratio =$this->getTurnoverRatio($p_info['all_pay_amount'],$tmp_game_ratio['ratio'],$tmp_game_ratio['turnover_ratio']);
|
|
|
|
|
|
|
|
// $tratio = $tmp_game_ratio['ratio'];
|
|
|
|
|
|
|
|
$turnover_type = $this->getTurnoverType($p_info['relation_game_id'], $k, $begintime, $endtime);
|
|
|
|
$turnover_type = $this->getTurnoverType($p_info['relation_game_id'], $k, $begintime, $endtime);
|
|
|
|
|
|
|
|
|
|
|
|
// if ($v['id'] == 5) {
|
|
|
|
|
|
|
|
// dump($p_info['all_pay_amount']);
|
|
|
|
|
|
|
|
// dump($turnover_type);
|
|
|
|
|
|
|
|
// dump($tmp_game_ratio);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($turnover_type == 2||$turnover_type == 4) {
|
|
|
|
if ($turnover_type == 2||$turnover_type == 4) {
|
|
|
|
$tratio =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
$tratio =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -1746,7 +1765,9 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$tratio1 =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
$tratio1 =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
$tratio2 =$tmp_game_ratio['ratio'];
|
|
|
|
$tratio2 =$tmp_game_ratio['ratio'];
|
|
|
|
$tratio = $tratio1-$tratio2+$company_ratio;
|
|
|
|
$tratio = $tratio1-$tratio2+$company_ratio;
|
|
|
|
if($tratio <= 0){ continue;}
|
|
|
|
if ($tratio <= 0) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$tratio -= 0;
|
|
|
|
$tratio -= 0;
|
|
|
|
if ($type == 2) {
|
|
|
|
if ($type == 2) {
|
|
|
@ -1781,19 +1802,11 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] = (string)$RewardRecordRes['fine'];
|
|
|
|
$handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] = (string)$RewardRecordRes['fine'];
|
|
|
|
$handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] = (string)$RewardRecordRes['reward'];
|
|
|
|
$handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] = (string)$RewardRecordRes['reward'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if ($p_info['relation_game_id'] == 191 && $v['id'] == 334) {
|
|
|
|
|
|
|
|
// dump($RewardRecordRes);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$p_info['statement_type']=0;
|
|
|
|
$p_info['statement_type']=0;
|
|
|
|
|
|
|
|
|
|
|
|
if ($p_info['pay_amount'] !='0') {
|
|
|
|
if ($p_info['pay_amount'] !='0') {
|
|
|
|
$va['game_list'][] = $p_info;
|
|
|
|
$va['game_list'][] = $p_info;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
for ($i=0; $i < $ratioCount; $i++) {
|
|
|
|
for ($i=0; $i < $ratioCount; $i++) {
|
|
|
|
$temp_game = [];
|
|
|
|
$temp_game = [];
|
|
|
@ -1802,20 +1815,12 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$tratio =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
$tratio =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
$tratio += $company_ratio;
|
|
|
|
$tratio += $company_ratio;
|
|
|
|
} elseif ($type == 0) {
|
|
|
|
} elseif ($type == 0) {
|
|
|
|
|
|
|
|
|
|
|
|
$turnover_type = $this->getTurnoverType($p_info['relation_game_id'], $k, $begintime, $endtime);
|
|
|
|
$turnover_type = $this->getTurnoverType($p_info['relation_game_id'], $k, $begintime, $endtime);
|
|
|
|
// if ($v['id'] == 5) {
|
|
|
|
|
|
|
|
// dump($p_info['all_pay_amount']);
|
|
|
|
|
|
|
|
// dump($turnover_type);
|
|
|
|
|
|
|
|
// dump($tmp_game_ratio);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
if ($turnover_type == 2 || $turnover_type == 4) {
|
|
|
|
if ($turnover_type == 2 || $turnover_type == 4) {
|
|
|
|
$tratio =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
$tratio =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$tratio = $tmp_game_ratio['ratio'];
|
|
|
|
$tratio = $tmp_game_ratio['ratio'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$turnover_type = $this->getTurnoverType($p_info['relation_game_id'], $k, $begintime, $endtime);
|
|
|
|
$turnover_type = $this->getTurnoverType($p_info['relation_game_id'], $k, $begintime, $endtime);
|
|
|
|
if ($turnover_type == 2 || $turnover_type == 4) {
|
|
|
|
if ($turnover_type == 2 || $turnover_type == 4) {
|
|
|
@ -1825,7 +1830,9 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$tratio1 =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
$tratio1 =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
|
|
|
|
$tratio2 =$tmp_game_ratio['ratio'];
|
|
|
|
$tratio2 =$tmp_game_ratio['ratio'];
|
|
|
|
$tratio = $tratio1-$tratio2+$company_ratio;
|
|
|
|
$tratio = $tratio1-$tratio2+$company_ratio;
|
|
|
|
if($tratio <= 0){ continue;}
|
|
|
|
if ($tratio <= 0) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$tratio -= 0;
|
|
|
|
$tratio -= 0;
|
|
|
|
if ($type == 2) {
|
|
|
|
if ($type == 2) {
|
|
|
@ -1861,10 +1868,6 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$handleed_data[$v['id'].$temp_game['statement_begin_time'].$temp_game['statement_end_time']]['fine'] = (string)$RewardRecordRes['fine'];
|
|
|
|
$handleed_data[$v['id'].$temp_game['statement_begin_time'].$temp_game['statement_end_time']]['fine'] = (string)$RewardRecordRes['fine'];
|
|
|
|
$handleed_data[$v['id'].$temp_game['statement_begin_time'].$temp_game['statement_end_time']]['reward'] = (string)$RewardRecordRes['reward'];
|
|
|
|
$handleed_data[$v['id'].$temp_game['statement_begin_time'].$temp_game['statement_end_time']]['reward'] = (string)$RewardRecordRes['reward'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if ($p_info['relation_game_id'] == 191 && $v['id'] == 334) {
|
|
|
|
|
|
|
|
// dump($RewardRecordRes);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$temp_game['statement_type']=0;
|
|
|
|
$temp_game['statement_type']=0;
|
|
|
|
|
|
|
|
|
|
|
|
$temp_game['relation_game_id']=$p_info["relation_game_id"];
|
|
|
|
$temp_game['relation_game_id']=$p_info["relation_game_id"];
|
|
|
@ -1875,11 +1878,11 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
if ($temp_game['pay_amount'] != '0') {
|
|
|
|
if ($temp_game['pay_amount'] != '0') {
|
|
|
|
$va['game_list'][] = $temp_game;
|
|
|
|
$va['game_list'][] = $temp_game;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$v['statement_info'][] = $va;
|
|
|
|
$v['statement_info'][] = $va;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$company_info = [
|
|
|
|
$company_info = [
|
|
|
|
'account'=>$v['account'],
|
|
|
|
'account'=>$v['account'],
|
|
|
|