From 7fc6609d7823fc95a58f029ecc49772566332b6c Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Thu, 9 Jul 2020 16:16:35 +0800 Subject: [PATCH] upt --- .../Controller/PlatformController.class.php | 59 +++++++++++-------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index 33f198070..eafe81835 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -673,30 +673,41 @@ class PlatformController extends ThinkController // 如果是市场专员那么只能看自己的 $isMarketAdmin = isMarketAdmin(); if ($isMarketAdmin) { - $statisticsMap['tab_promote.admin_id'] = $_REQUEST['admin_user_id'] = $map['tp2.admin_id'] = is_login(); - } - - if (isset($_REQUEST['server_id'])||isset($_REQUEST['game_name'])||isset($_REQUEST['promote_id'])||isset($_REQUEST['admin_id'])||isset($_REQUEST['admin_user_id'])) { - $data = M('promote', 'tab_')->alias('tp1') - ->field('tp1.account as promote_account,tp1.id, - floor(sum(pay_amount)*100) as count') - ->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left') - ->join("tab_spend as s use INDEX(search) on tp2.id = s.promote_id", 'left') - ->join("tab_game as g on g.id = s.game_id", 'left') - ->where($map) - ->group('tp1.id') - ->order('count desc') - ->select(); - } else { - $statisticsMap['time'] =$map['pay_time']; - setPowerPromoteIds($statisticsMap, 'tab_promote.id'); - $data = M('promote_statistics', 'tab_') - ->field("promote_account,promote_id as id,sum(count) count") - ->join('tab_promote on tab_promote.id = tab_promote_statistics.promote_id', 'left') - ->where($statisticsMap) - ->group("promote_id") - ->select(); - } + $map['s.market_admin_id'] = $statisticsMap['tab_promote.admin_id'] = $_REQUEST['admin_user_id'] = $map['tp2.admin_id'] = is_login(); + } + + $data = M('promote', 'tab_')->alias('tp1') + ->field('tp1.account as promote_account,tp1.id, + floor(sum(pay_amount)*100) as count') + ->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left') + ->join("tab_spend as s use INDEX(search) on tp2.id = s.promote_id", 'left') + ->join("tab_game as g on g.id = s.game_id", 'left') + ->where($map) + ->group('tp1.id') + ->order('count desc') + ->select(); + + // if (isset($_REQUEST['server_id'])||isset($_REQUEST['game_name'])||isset($_REQUEST['promote_id'])||isset($_REQUEST['admin_id'])||isset($_REQUEST['admin_user_id'])) { + // $data = M('promote', 'tab_')->alias('tp1') + // ->field('tp1.account as promote_account,tp1.id, + // floor(sum(pay_amount)*100) as count') + // ->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left') + // ->join("tab_spend as s use INDEX(search) on tp2.id = s.promote_id", 'left') + // ->join("tab_game as g on g.id = s.game_id", 'left') + // ->where($map) + // ->group('tp1.id') + // ->order('count desc') + // ->select(); + // } else { + // $statisticsMap['time'] =$map['pay_time']; + // setPowerPromoteIds($statisticsMap, 'tab_promote.id'); + // $data = M('promote_statistics', 'tab_') + // ->field("promote_account,promote_id as id,sum(count) count") + // ->join('tab_promote on tab_promote.id = tab_promote_statistics.promote_id', 'left') + // ->where($statisticsMap) + // ->group("promote_id") + // ->select(); + // } // var_dump($data);die();