优化上游比例获取

master
chenzhi 5 years ago
parent 47e57f48e6
commit 9d9eae85ec

@ -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;
}

@ -323,7 +323,6 @@ class CompanyStatementSetController extends Controller {
if($tratio <= 0){continue;}
}
}
if($v['first_company_type'] == 1){
$game['first_ratio']=$tratio;
$game['second_ratio']=100-$tratio;

Loading…
Cancel
Save