From 77463c7e1d0a4e10d5d006eb2afb09fbb7ff0c59 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 10 Feb 2020 16:38:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E5=9C=BA=E7=BB=93=E7=AE=97=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=B8=8A=E6=B8=B8=E6=B5=81=E6=B0=B4=E7=AC=A6=E5=8F=B7?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index a37e87067..a5edb032a 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2018,10 +2018,23 @@ function getWithdrawNumber() { //上有流水计算 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]) - ->order('begin_total_amount Desc') - ->find(); + ->limit(0,2) + ->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,'.','');