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时返回最低分成比例
function getGameCpRadio($game_id,$amount,$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 {
//取两条
$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();
@ -2141,7 +2141,6 @@ function getGameCpRadio($game_id,$amount,$type) {
}
}
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 =[
"company_id"=>$company_info['id'],
"company_type"=>$v['company_type'],
@ -651,7 +651,7 @@ class CompanyStatementController extends ThinkController
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){
$lask_id = $LackStatement->add($lackcompany);

@ -220,7 +220,7 @@ class CompanyStatementSetController extends Controller {
$dataurl .= $this->cpapihost."&".http_build_query($arr);
$html = file_get_contents($dataurl);
//防止并发压力
sleep(5);
sleep(3);
$rsp = json_decode($html,true);
if($rsp['code'] != 1){
echo $rsp['error'].PHP_EOL;die;
@ -228,11 +228,11 @@ class CompanyStatementSetController extends Controller {
$rsp = $rsp['data'];
}
//整合数据本地
foreach($locals as $k=>$v){
$cpList[$k]["list"] = $v["list"];
}
//整合数据,聚合
foreach($rsp as $k=>$v){
if(isset($cpList[$k]["list"])){
@ -241,7 +241,7 @@ class CompanyStatementSetController extends Controller {
if(isset($cpList[$k]["list"][$ke])){
$cpList[$k]["list"][$ke]['pay_money'] += $va['pay_money'];
}else{
$cpList[$k]["list"][$ke] = ["pay_money"=>$va['pay_money']];
$cpList[$k]["list"][$ke] = $va;
}
}
}else{
@ -304,9 +304,12 @@ class CompanyStatementSetController extends Controller {
$game['game_name'] =$ke;
//获取游戏id及比例
$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)){
$game['relation_game_id']=0;
// $game['sum_money']=0;
$tratio = 0;
}else{
//获取比例
@ -323,7 +326,6 @@ class CompanyStatementSetController extends Controller {
if($tratio <= 0){continue;}
}
}
if($v['first_company_type'] == 1){
$game['first_ratio']=$tratio;
$game['second_ratio']=100-$tratio;
@ -402,7 +404,6 @@ class CompanyStatementSetController extends Controller {
$add_data['pay_amount'] -= $server_count;;
}
}
$add_data['statement_info'] = json_encode($add_data['statement_info'],JSON_UNESCAPED_UNICODE);
if($type == 2 && $add_data['statement_money'] == 0){
//金额为0不补点
@ -767,7 +768,7 @@ class CompanyStatementSetController extends Controller {
$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')
->join("tab_game g on s.game_id = g.id")
->join("left join tab_game g on s.game_id = g.id")
->select();
if(empty($list)){continue;}
foreach($list as $k=>$v){
@ -1022,7 +1023,7 @@ class CompanyStatementSetController extends Controller {
"ali_user"=>$v['ali_user'],
"ali_account"=>$v['ali_account']
];
if($v['statement_money'] < 300){
if($v['pay_amount'] < 300){
$lackcompany =[
"company_id"=>$k,
"company_type"=>2,
@ -1066,7 +1067,7 @@ class CompanyStatementSetController extends Controller {
if($type == 2 && $v['statement_money'] == 0){
//补点不存
}else{
if($v['statement_money'] < 300){
if($v['pay_amount'] < 300){
//存未满
if($lackcompany['pay_amount'] > 0){
$lask_id = $LackStatement->add($lackcompany);

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

Loading…
Cancel
Save