Merge branch 'hotfix/statement_ratio_change' of wmtx/platform into master

优化上游cp结算比例问题
master
廖金灵 4 years ago committed by Gogs
commit 194523f00f

@ -220,7 +220,7 @@ class CompanyStatementSetController extends Controller {
$dataurl .= $this->cpapihost."&".http_build_query($arr); $dataurl .= $this->cpapihost."&".http_build_query($arr);
$html = file_get_contents($dataurl); $html = file_get_contents($dataurl);
//防止并发压力 //防止并发压力
sleep(5); sleep(3);
$rsp = json_decode($html,true); $rsp = json_decode($html,true);
if($rsp['code'] != 1){ if($rsp['code'] != 1){
echo $rsp['error'].PHP_EOL;die; echo $rsp['error'].PHP_EOL;die;
@ -228,11 +228,11 @@ class CompanyStatementSetController extends Controller {
$rsp = $rsp['data']; $rsp = $rsp['data'];
} }
//整合数据本地 //整合数据本地
foreach($locals as $k=>$v){ foreach($locals as $k=>$v){
$cpList[$k]["list"] = $v["list"]; $cpList[$k]["list"] = $v["list"];
} }
//整合数据,聚合 //整合数据,聚合
foreach($rsp as $k=>$v){ foreach($rsp as $k=>$v){
if(isset($cpList[$k]["list"])){ if(isset($cpList[$k]["list"])){
@ -241,7 +241,7 @@ class CompanyStatementSetController extends Controller {
if(isset($cpList[$k]["list"][$ke])){ if(isset($cpList[$k]["list"][$ke])){
$cpList[$k]["list"][$ke]['pay_money'] += $va['pay_money']; $cpList[$k]["list"][$ke]['pay_money'] += $va['pay_money'];
}else{ }else{
$cpList[$k]["list"][$ke] = ["pay_money"=>$va['pay_money']]; $cpList[$k]["list"][$ke] = $va;
} }
} }
}else{ }else{
@ -304,9 +304,12 @@ class CompanyStatementSetController extends Controller {
$game['game_name'] =$ke; $game['game_name'] =$ke;
//获取游戏id及比例 //获取游戏id及比例
$game_id = $GameDb->where("relation_game_name='{$ke}' OR original_package_name='{$ke}'")->field("id,relation_game_id")->find(); $game_id = $GameDb->where("relation_game_name='{$ke}' OR original_package_name='{$ke}'")->field("id,relation_game_id")->find();
if(empty($game_id) && isset($va['unique_code']) && !empty($va['unique_code'])){
$unique_code = $va['unique_code'];
$game_id = $GameDb->where("unique_code='{$unique_code }'")->field("id,relation_game_id")->find();
}
if(empty($game_id)){ if(empty($game_id)){
$game['relation_game_id']=0; $game['relation_game_id']=0;
// $game['sum_money']=0;
$tratio = 0; $tratio = 0;
}else{ }else{
//获取比例 //获取比例
@ -401,7 +404,6 @@ class CompanyStatementSetController extends Controller {
$add_data['pay_amount'] -= $server_count;; $add_data['pay_amount'] -= $server_count;;
} }
} }
$add_data['statement_info'] = json_encode($add_data['statement_info'],JSON_UNESCAPED_UNICODE); $add_data['statement_info'] = json_encode($add_data['statement_info'],JSON_UNESCAPED_UNICODE);
if($type == 2 && $add_data['statement_money'] == 0){ if($type == 2 && $add_data['statement_money'] == 0){
//金额为0不补点 //金额为0不补点

Loading…
Cancel
Save