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

master
陈志 5 years ago committed by Gogs
commit 97f79a9c0f

@ -2121,10 +2121,10 @@ function getPromoteCompanyList() {
//获取游戏cp分成比例 $type=false时返回最低分成比例 //获取游戏cp分成比例 $type=false时返回最低分成比例
function getGameCpRadio($game_id,$amount,$type) { function getGameCpRadio($game_id,$amount,$type) {
if (!$type) { if (!$type) {
$data = M('cp_game_ratio','tab_')->where(['game_id'=>$game_id])->order('begin_total_amount asc')->find(); $data = M('cp_game_ratio','tab_')->where(['game_id'=>$game_id,'is_del'=>0])->order('begin_total_amount asc')->find();
} else { } else {
//取两条 //取两条
$ladderData = M('cp_game_ratio','tab_')->where(['game_id'=>$game_id,'begin_total_amount'=>['elt',$amount]])->limit(0,2)->order('begin_total_amount desc')->select(); $ladderData = M('cp_game_ratio','tab_')->where(['game_id'=>$game_id,'begin_total_amount'=>['elt',$amount],'is_del'=>0])->limit(0,2)->order('begin_total_amount desc')->select();
// dump($ladderData);die(); // dump($ladderData);die();
@ -2141,7 +2141,6 @@ function getGameCpRadio($game_id,$amount,$type) {
} }
} }
return $data['ratio']?$data['ratio']:0; return $data['ratio']?$data['ratio']:0;
} }

@ -616,7 +616,7 @@ class CompanyStatementController extends ThinkController
} }
//创建基础未满基础信息 //创建基础未满基础信息
if($va['statement_money'] < $no_pool_money){ if($va['pay_amount'] < $no_pool_money){
$lackcompany =[ $lackcompany =[
"company_id"=>$company_info['id'], "company_id"=>$company_info['id'],
"company_type"=>$v['company_type'], "company_type"=>$v['company_type'],
@ -651,7 +651,7 @@ class CompanyStatementController extends ThinkController
array_multisort($last_names,SORT_DESC,SORT_STRING,$va['statement_info']); array_multisort($last_names,SORT_DESC,SORT_STRING,$va['statement_info']);
} }
} }
if($va['statement_money'] < $no_pool_money){ if($va['pay_amount'] < $no_pool_money){
//依旧小于不结算金额存旧版 //依旧小于不结算金额存旧版
if($lackcompany['pay_amount'] > 0){ if($lackcompany['pay_amount'] > 0){
$lask_id = $LackStatement->add($lackcompany); $lask_id = $LackStatement->add($lackcompany);

@ -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;
@ -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{
//获取比例 //获取比例
@ -323,7 +326,6 @@ class CompanyStatementSetController extends Controller {
if($tratio <= 0){continue;} if($tratio <= 0){continue;}
} }
} }
if($v['first_company_type'] == 1){ if($v['first_company_type'] == 1){
$game['first_ratio']=$tratio; $game['first_ratio']=$tratio;
$game['second_ratio']=100-$tratio; $game['second_ratio']=100-$tratio;
@ -402,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不补点
@ -767,7 +768,7 @@ class CompanyStatementSetController extends Controller {
$spenMap['s.promote_id']=["in",$pres['ids']]; $spenMap['s.promote_id']=["in",$pres['ids']];
//获取支付记录 //获取支付记录
$list = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($spenMap)->group('game_id') $list = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($spenMap)->group('game_id')
->join("tab_game g on s.game_id = g.id") ->join("left join tab_game g on s.game_id = g.id")
->select(); ->select();
if(empty($list)){continue;} if(empty($list)){continue;}
foreach($list as $k=>$v){ foreach($list as $k=>$v){
@ -1022,7 +1023,7 @@ class CompanyStatementSetController extends Controller {
"ali_user"=>$v['ali_user'], "ali_user"=>$v['ali_user'],
"ali_account"=>$v['ali_account'] "ali_account"=>$v['ali_account']
]; ];
if($v['statement_money'] < 300){ if($v['pay_amount'] < 300){
$lackcompany =[ $lackcompany =[
"company_id"=>$k, "company_id"=>$k,
"company_type"=>2, "company_type"=>2,
@ -1066,7 +1067,7 @@ class CompanyStatementSetController extends Controller {
if($type == 2 && $v['statement_money'] == 0){ if($type == 2 && $v['statement_money'] == 0){
//补点不存 //补点不存
}else{ }else{
if($v['statement_money'] < 300){ if($v['pay_amount'] < 300){
//存未满 //存未满
if($lackcompany['pay_amount'] > 0){ if($lackcompany['pay_amount'] > 0){
$lask_id = $LackStatement->add($lackcompany); $lask_id = $LackStatement->add($lackcompany);

@ -267,7 +267,7 @@ class PromoteCompanyController extends ThinkController
$v['verify_log'] = json_decode($v['verify_log'], true); $v['verify_log'] = json_decode($v['verify_log'], true);
$v["create"]= "{$v['verify_log']['create_user']} <br> {$v['verify_log']['create_time']}"; $v["create"]= "{$v['verify_log']['create_user']} <br> {$v['verify_log']['create_time']}";
if(isset($v['verify_log']['market_user'])){ if(isset($v['verify_log']['market_user'])){
if($v['status'] == -1){ if($v['verify_status'] == -1){
$ts = "审核拒绝"; $ts = "审核拒绝";
}else{ }else{
$ts = "审核通过"; $ts = "审核通过";
@ -278,7 +278,7 @@ class PromoteCompanyController extends ThinkController
} }
if(isset($v['verify_log']['admin_user'])){ if(isset($v['verify_log']['admin_user'])){
if($v['status'] == -2){ if($v['verify_status'] == -2){
$ts = "审核拒绝"; $ts = "审核拒绝";
}else{ }else{
$ts = "审核通过"; $ts = "审核通过";

Loading…
Cancel
Save