Merge pull request 'hotfix/fiance_statement_bug_20210420' (#282) from hotfix/fiance_statement_bug_20210420 into release

优化独立减罚
master
陈志 4 years ago
commit 90dc521e2a

@ -1600,6 +1600,10 @@ class CompanyStatementSetController extends Controller {
$where = [
"_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){//月结
$where['settlement_type']=2;
@ -1687,7 +1691,32 @@ class CompanyStatementSetController extends Controller {
$v['reward'] = 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'];
//服务器费用
if ($type < 2) {
@ -1712,7 +1741,6 @@ class CompanyStatementSetController extends Controller {
$templist = $va['game_list'];
$va['game_list'] = [];
foreach ($templist as $p_id => $p_info) {
$ratioCount = count($promoteCompanyGameRatio[$p_info['relation_game_id']]);
$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 += $company_ratio;
} 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);
// if ($v['id'] == 5) {
// dump($p_info['all_pay_amount']);
// dump($turnover_type);
// dump($tmp_game_ratio);
// }
if ($turnover_type == 2||$turnover_type == 4) {
$tratio =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
} 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']);
$tratio2 =$tmp_game_ratio['ratio'];
$tratio = $tratio1-$tratio2+$company_ratio;
if($tratio <= 0){ continue;}
if ($tratio <= 0) {
continue;
}
}
$tratio -= 0;
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]['reward'] = (string)$RewardRecordRes['reward'];
}
// if ($p_info['relation_game_id'] == 191 && $v['id'] == 334) {
// dump($RewardRecordRes);
// }
$p_info['statement_type']=0;
if ($p_info['pay_amount'] !='0') {
$va['game_list'][] = $p_info;
}
} else {
for ($i=0; $i < $ratioCount; $i++) {
$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 += $company_ratio;
} elseif ($type == 0) {
$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) {
$tratio =$this->getTurnoverRatio($p_info['all_pay_amount'], $tmp_game_ratio['ratio'], $tmp_game_ratio['turnover_ratio']);
} else {
$tratio = $tmp_game_ratio['ratio'];
}
} else {
$turnover_type = $this->getTurnoverType($p_info['relation_game_id'], $k, $begintime, $endtime);
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']);
$tratio2 =$tmp_game_ratio['ratio'];
$tratio = $tratio1-$tratio2+$company_ratio;
if($tratio <= 0){ continue;}
if ($tratio <= 0) {
continue;
}
}
$tratio -= 0;
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']]['reward'] = (string)$RewardRecordRes['reward'];
}
// if ($p_info['relation_game_id'] == 191 && $v['id'] == 334) {
// dump($RewardRecordRes);
// }
$temp_game['statement_type']=0;
$temp_game['relation_game_id']=$p_info["relation_game_id"];
@ -1875,11 +1878,11 @@ class CompanyStatementSetController extends Controller {
if ($temp_game['pay_amount'] != '0') {
$va['game_list'][] = $temp_game;
}
}
}
}
$v['statement_info'][] = $va;
}
}
$company_info = [
'account'=>$v['account'],

Loading…
Cancel
Save