From 8f2fce9b9864e9d54f487c0094b286b373b89d76 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 5 Aug 2021 10:21:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ExportController.class.php | 20 ++++---- .../Controller/SpendController.class.php | 23 +++++---- Application/Admin/View/Spend/lists.html | 50 ++++++++++++++++++- 3 files changed, 70 insertions(+), 23 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index efe4386b8..f407c14fe 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -1162,16 +1162,10 @@ class ExportController extends Controller unset($_REQUEST['pay_game_status']); } - $marketAdminId = I('market_admin_id', 0); - if ($marketAdminId) { - $map['market_admin_id'] = $marketAdminId; - } - - $isMarketAdmin = isMarketAdmin(); - if ($isMarketAdmin) { - $userAuth = session('user_auth'); - $map['market_admin_id'] = $userAuth['uid']; - } + $marketAdminIds = getSearchAdminIds('market_admin_id'); + if (is_array($marketAdminIds)) { + $map['market_admin_id'] = ['in', $marketAdminIds]; + } setPowerPromoteIds($map,'promote_id'); @@ -1231,6 +1225,7 @@ class ExportController extends Controller 'game_id' => '所属CP', 'promote_account' => L('Subordinate_channel'), '0 as company_name' => '所属推广公司', + '1 as admin_department' => '所属市场部', 'market_admin_id' => '所属市场专员', 'merchant_id' => '所属商户', 'spend_ip' => '充值ip', @@ -1305,8 +1300,10 @@ class ExportController extends Controller ->limit(($i-1)*$perSize ,$perSize) ->order($order ? $order : 'pay_time desc') ->select(); + $adminIds = array_column($xlsData, 'market_admin_id'); + $adminDepartments = getAdminDepartmentList($adminIds); if ($showMarketAdmin == 1) { - $adminUsernameList = getAdminUsernameList(array_column($xlsData, 'market_admin_id')); + $adminUsernameList = getAdminUsernameList($adminIds); } $promoters = D('Promote')->where(['id'=>['in', array_unique(array_column($xlsData, 'promote_id'))]])->field('id, company_id')->select(); $promoters = $promoters ? array_column($promoters, 'company_id', 'id') : []; @@ -1341,6 +1338,7 @@ class ExportController extends Controller $value['pay_way'] = get_pay_way($value['pay_way']); $value['pay_status'] = get_info_status($value['pay_status'],9); $value['pay_game_status'] = get_info_status($value['pay_game_status'],14); + $value['admin_department'] = $adminDepartments[$value['market_admin_id']] ?? '无'; if ($showMarketAdmin == 1) { $value['market_admin_id'] = $adminUsernameList[$value['market_admin_id']] ?? '无'; } diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index 7bc3f9317..6992f84ac 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -98,16 +98,12 @@ class SpendController extends ThinkController } } - $marketAdminId = 0; $isMarketAdmin = isMarketAdmin(); - if ($isMarketAdmin) { - $userAuth = session('user_auth'); - $marketAdminId = $userAuth['uid']; - } else { - $marketAdminId = I('market_admin_id', 0); - } - if ($marketAdminId > 0) { - $map['market_admin_id'] = $marketAdminId; + $isMarketLeader = isMarketLeader(); + $marketAdminIds = getSearchAdminIds('market_admin_id'); + + if (is_array($marketAdminIds)) { + $map['market_admin_id'] = ['in', $marketAdminIds]; } setPowerPromoteIds($map,'promote_id'); @@ -146,10 +142,13 @@ class SpendController extends ThinkController $data = D(self::model_name)->lists($_GET["p"], $map, $order); if (!empty($data['data'])) { - $adminUsernameList = getAdminUsernameList(array_column($data['data'], 'market_admin_id')); + $adminIds = array_column($data['data'], 'market_admin_id'); + $adminUsernameList = getAdminUsernameList($adminIds); + $adminDepartments = getAdminDepartmentList($adminIds); foreach ($data['data'] as $key=>&$value) { ($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):''; $value['market_admin_username'] = $adminUsernameList[$value['market_admin_id']] ?? '无'; + $value['admin_department'] = $adminDepartments[$value['market_admin_id']] ?? '无'; $value['is_check_str'] = D(self::model_name)::IsCheckStr[$value['is_check']]; $value['is_refund_str'] = D(self::model_name)::IsRefundStr[$value['is_refund']]; //拆分游戏名称和设备类型 @@ -159,6 +158,10 @@ class SpendController extends ThinkController } } + $departments = M('department', 'sys_')->select(); + + $this->assign('departments', $departments); + $this->assign('isMarketLeader', $isMarketLeader); $this->assign('showMarketAdmin', session('user_auth')['show_market_admin']); $this->assign('showPromote', session('user_auth')['show_promote']); $this->assign('isMarketAdmin', $isMarketAdmin); diff --git a/Application/Admin/View/Spend/lists.html b/Application/Admin/View/Spend/lists.html index 4886c797d..040ab7f24 100644 --- a/Application/Admin/View/Spend/lists.html +++ b/Application/Admin/View/Spend/lists.html @@ -160,6 +160,17 @@ + +
+ +
+ +
- +