From 4fb2806656ab4f4f81005d4ba9ffcbe5f5ca11e3 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Tue, 7 Jan 2020 13:34:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B8=82=E5=9C=BA=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/QueryController.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index 7e5b41c82..f5a44a199 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -1051,8 +1051,9 @@ class QueryController extends ThinkController //关联表获取会长账号名 $data = M()->table('('.$data.') as a') - ->field("my_time,pay_amount,game_id,game_name,game_names,promote_id,promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account") + ->field("my_time,pay_amount,a.game_id,game_name,game_names,a.promote_id,a.promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account,ratio,last_turnover_ratio") ->join("left join tab_promote on root_id = tab_promote.id") + ->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.game_id and tab_ratio.promote_id=root_id") ->page($page,$row) ->where($map) ->group("my_time,game_names,root_id") @@ -1064,7 +1065,12 @@ class QueryController extends ThinkController foreach($data as $key => $value) { $data[$key]['upstream'] = $value['pay_amount'] * 0.2; - $data[$key]['downstream'] = $value['pay_amount'] * 0.7; + + if ($value['ratio']) { + $data[$key]['downstream'] = $value['pay_amount'] * ($value['ratio']*0.01); + } else { + $data[$key]['downstream'] = $value['pay_amount'] * 0.1; + } $data[$key]['highquality'] = ($value['pay_amount']-$data[$key]['upstream']-$data[$key]['downstream']) * (1-0.0672);