From 3f42d2967c97ea5cb7e3bea640e40ac36d4817be Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 30 Jun 2020 10:29:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 863207129..8d73aa48c 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2472,7 +2472,7 @@ function getAvailableBalance($promote_id=0,$game_id=0,$server_id='') { function getMarketGroupIds() { - return ['11', '12']; + return M('auth_group', 'sys_')->where(['title' => ['like', '%市场专员%']])->getField('id', true); } function getAdmins() @@ -2483,6 +2483,9 @@ function getAdmins() function getMarketAdmins() { $ids = getMarketGroupIds(); + if (count($ids) == 0) { + return []; + } $adminIds = M('auth_group_access', 'sys_')->where(['group_id' => ['in', $ids]])->getField('uid', true); return M('ucenter_member', 'sys_')->where(['id' => ['in', $adminIds]])->select(); } @@ -2547,6 +2550,9 @@ function isMarketLeader() function isMarketAdmin() { $ids = getMarketGroupIds(); + if (count($ids) == 0) { + return false; + } $userAuth = session('user_auth'); $adminIds = M('auth_group_access', 'sys_')->where(['group_id' => ['in', $ids]])->getField('uid', true); return in_array($userAuth['uid'], $adminIds);