市场结算管理上游流水符号修正

master
zhengyongxing 5 years ago
parent 2ba96aa424
commit 77463c7e1d

@ -2018,10 +2018,23 @@ function getWithdrawNumber() {
//上有流水计算 //上有流水计算
function caculateUpstream($game_id,$pay_amount) { function caculateUpstream($game_id,$pay_amount) {
$data = M('cp_game_ratio','tab_') $ladderData = M('cp_game_ratio','tab_')
->where(['game_id'=>$game_id,'begin_total_amount'=>['elt',$pay_amount],'is_del'=>0]) ->where(['game_id'=>$game_id,'begin_total_amount'=>['elt',$pay_amount],'is_del'=>0])
->order('begin_total_amount Desc') ->limit(0,2)
->find(); ->order('begin_total_amount desc')
->select();
foreach($ladderData as $key => $value) {
if ($value['instanceof'] == 1 && $value['begin_total_amount'] <= $pay_amount
|| $value['instanceof'] == 2 && $value['begin_total_amount'] != $pay_amount ) {
$data['ratio'] = $value['ratio'];
break;
} else {
$data['ratio'] = $value['ratio'];
}
}
return number_format($pay_amount*($data['ratio']/100),2,'.',''); return number_format($pay_amount*($data['ratio']/100),2,'.','');

Loading…
Cancel
Save