From 80597c48945e7910279e3397d4aa28eb8438ca27 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Thu, 9 Jul 2020 10:16:26 +0800 Subject: [PATCH] upt --- .../Controller/ExportController.class.php | 2 +- .../Controller/PlatformController.class.php | 31 ++++++++++++++----- .../View/Platform/promote_statistics.html | 11 ++++++- .../View/Platform/promotepay_statistics.html | 9 ++++++ 4 files changed, 44 insertions(+), 9 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 3b6269a17..b847ea327 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -3731,7 +3731,7 @@ class ExportController extends Controller ->field('tab_promote.id, company_name, sys_member.nickname as admin_username') ->join("tab_promote_company on tab_promote.company_id = tab_promote_company.id", 'left') ->join('sys_member on tab_promote.admin_id = sys_member.uid', 'left') - ->where("tab_promote.id in ('".implode(',', array_column($data, 'id'))."')")->select() : []; + ->where("tab_promote.id in (".implode(',', array_column($data, 'id')).")")->select() : []; $companys = $companys ? array_column($companys, null, 'id') : []; foreach ($data as &$item) { $item['company_name'] = $companys[$item['id']]['company_name'] ?? '无'; diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index 40f0095e2..8cbe9c793 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -446,6 +446,10 @@ class PlatformController extends ThinkController $play_info_map = " and upi.server_id = '{$_REQUEST['server_id']}' and upi.game_name like '{$_REQUEST['game_name']}%'"; } + if (!empty($_REQUEST['admin_id'])) { + $map['promote.admin_id'] = $_REQUEST['admin_id']; + } + $today = total(1); $week = total(2); $mounth = total(3); @@ -467,7 +471,7 @@ class PlatformController extends ThinkController // 如果是市场专员那么只能看自己的 $isMarketAdmin = isMarketAdmin(); if ($isMarketAdmin) { - $map['tab_promote.admin_id'] = session('user_auth'); + $map['promote.admin_id'] = session('user_auth'); } $data = M("User u","tab_") @@ -504,6 +508,7 @@ class PlatformController extends ThinkController ->join("tab_promote promote ON u.promote_id = promote.id","left") ->join($play_map ? "tab_user_play as up on up.user_id = u.id " . $play_map : false) ->join($play_info_map ? "tab_user_play_info as upi on upi.user_id = u.id " . $play_info_map : false) + ->join('tab_game on u.fgame_id = tab_game.id') ->where($tmap) ->group('id') ->order('register_time') @@ -581,7 +586,7 @@ class PlatformController extends ThinkController ->field('tab_promote.id, company_name, sys_member.nickname as admin_username') ->join("tab_promote_company on tab_promote.company_id = tab_promote_company.id", 'left') ->join('sys_member on tab_promote.admin_id = sys_member.uid', 'left') - ->where("tab_promote.id in ('".implode(',', array_column($data, 'id'))."')")->select() : []; + ->where("tab_promote.id in (".implode(',', array_column($data, 'id')).")")->select() : []; $companys = $companys ? array_column($companys, null, 'id') : []; foreach ($data as &$item) { $item['company_name'] = $companys[$item['id']]['company_name'] ?? '无'; @@ -590,6 +595,7 @@ class PlatformController extends ThinkController $this->meta_title = '渠道注册统计列表'; $this->assign("is_admin",is_administrator()); $this->assign('list_data', $data); + $this->assign('admin_users', M('member')->field('uid,nickname')->select()); $this->assign('total', $total); $this->display(); } @@ -645,7 +651,12 @@ class PlatformController extends ThinkController setPowerPromoteIds($map, 'tp1.id'); if (isset($_REQUEST['promote_id'])) { - $map['tp1.id'] = $_REQUEST['promote_id']; + //$map['tp1.id'] = $_REQUEST['promote_id']; + $promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select(); + if ($promoter_ids) { + $map['tp1.id'] = $_REQUEST['promote_id']; + $map['tp2.id'] = ['in', implode(',', array_column($promoter_ids, 'id'))]; + } } else { $map['tp1.chain'] = '/'; } @@ -669,6 +680,10 @@ class PlatformController extends ThinkController $map['s.sdk_version'] = $_REQUEST['game_type']; } + if (!empty($_REQUEST['admin_id'])) { + $map['s.market_admin_id'] = $_REQUEST['admin_id']; + } + if (isset($_REQUEST['sdk_version'])||isset($_REQUEST['server_id'])||isset($_REQUEST['game_name'])||isset($_REQUEST['promote_id'])) { $data = M('promote', 'tab_')->alias('tp1') ->field('tp1.account as promote_account,tp1.id,g.relation_game_name, @@ -719,16 +734,18 @@ class PlatformController extends ThinkController $tmdata[$v['id']]['promote_account'] = $v['promote_account']; $tmdata[$v['id']]['count'] = 0; } + + $tmdata[$v['id']]['id'] = $v['id']; } $data = []; foreach($tmdata as $k => $v){ $data[] = $v; } // dd($data); - unset($map['tp1.id']); + unset($map['tp1.id'], $map['tp2.id']); unset($map['tp1.chain']); unset($tmap['tp1.id']); - unset($tmap['tp1.chain']); + unset($tmap['tp1.chain'], $tmap['tp2.id']); $map['s.promote_id'] = 0; $tmap['s.promote_id'] = 0; $authorityData['count'] = 0; @@ -796,12 +813,11 @@ class PlatformController extends ThinkController $data = my_sort($data, $data_order_type, (int)$data_order); $size = $row;//每页显示的记录数 - $pnum = ceil(count($data) / $size); //总页数,ceil()函数用于求大于数字的最小整数 $companys = !empty($data) ? M('promote', 'tab_') ->field('tab_promote.id, company_name, sys_member.nickname as admin_username') ->join("tab_promote_company on tab_promote.company_id = tab_promote_company.id", 'left') ->join('sys_member on tab_promote.admin_id = sys_member.uid', 'left') - ->where("tab_promote.id in ('".implode(',', array_column($data, 'id'))."')")->select() : []; + ->where("tab_promote.id in (".implode(',', array_column($data, 'id')).")")->select() : []; $companys = $companys ? array_column($companys, null, 'id') : []; foreach ($data as &$item) { $item['company_name'] = $companys[$item['id']]['company_name'] ?? '无'; @@ -833,6 +849,7 @@ class PlatformController extends ThinkController $data = array_slice($data, ($arraypage - 1) * $size, $size); $this->meta_title = '渠道充值统计列表'; $this->assign('list_data', $data); + $this->assign('admin_users', M('member')->field('uid,nickname')->select()); $this->assign("is_admin",is_administrator()); $this->display(); diff --git a/Application/Admin/View/Platform/promote_statistics.html b/Application/Admin/View/Platform/promote_statistics.html index badc4bb01..80e24e4f9 100644 --- a/Application/Admin/View/Platform/promote_statistics.html +++ b/Application/Admin/View/Platform/promote_statistics.html @@ -61,6 +61,15 @@ +