From f37f6c51dde272f53b8f1cb3bb6541c45cf5aa6e Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Mon, 31 Aug 2020 18:56:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/UserController.class.php | 9 +++++++++ .../Home/Controller/BaseController.class.php | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index 48c7c8bfd..dc32cb6f0 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -387,6 +387,15 @@ class UserController extends AdminController $this->error('该手机号码已经添加过!'); } } + + $group = M('auth_group', 'sys_')->where(['id' => I('auth')])->find(); + if (is_null($group)) { + $this->error('角色类型不存在!'); + } else { + if (!IS_ROOT && strpos($group['title'], '市场专员') !== false && !isMarketLeader()) { + $this->error('市场专员编辑仅允许市场总监操作!'); + } + } // if (isset($_POST['mobile']) && $_POST['mobile'] != '') { // $dx = A('Phone'); // $res = $dx->check_tel_code($_POST['mobile'], $_POST['code']); diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index d9cec83e2..fa876e441 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -391,6 +391,19 @@ class BaseController extends HomeController if ($permission == 'view-user-recharge') { $promoteService = new PromoteService(); $topPromote = $promoteService->getTopPromote($promote); + + /** + * 市场部特殊推广公司的规则 + */ + $onlyPresidentList = [330, 331, 332]; + if (in_array($topPromote['company_id'], $onlyPresidentList)) { + if ($topPromote['can_view_recharge'] == 1 && $promote['level'] == 1) { + return true; + } else { + return false; + } + } + if ($topPromote['can_view_recharge'] == 1) { return true; }