diff --git a/app/controller/manager/Business.php b/app/controller/manager/Business.php index fe86e4d..dc7466c 100644 --- a/app/controller/manager/Business.php +++ b/app/controller/manager/Business.php @@ -97,6 +97,11 @@ class Business extends Base return $this->json(0, 'success', $list); } + //商家不能指派代理商 + $roles = explode(",", $this->auth['roles']); + $this->data["isAdmin"] = in_array(Member::MANAGER_ROLE_ID, $roles); + + return $this->view(); } @@ -449,7 +454,7 @@ class Business extends Base return $this->error("商家信息错误"); } $qrData = $this->request->domain() . "/business_code_to_coupon_list?business_code=" . $businessCode; - + $w = 3000;//尺寸 $logoImg = app()->getRootPath().'public/static/images/icon-logo.jpg'; diff --git a/app/controller/manager/Index.php b/app/controller/manager/Index.php index b92ab3e..5f44bdd 100644 --- a/app/controller/manager/Index.php +++ b/app/controller/manager/Index.php @@ -62,8 +62,10 @@ class Index extends Base $menus = CmsRepository::getInstance()->getMenuList(Menu::TYPE_MENU, Menu::SHOW_YES)->toArray(); $userId = $this->auth['user_id'] ?? 0; + $menus = CmsRepository::getInstance()->handMenuRule($userId, $menus); $menus = CmsRepository::getInstance()->buildMenuChild(0, $menus, 'child'); + $res['menuInfo'] = $menus; return json($res); diff --git a/app/traits/cms/MenuTrait.php b/app/traits/cms/MenuTrait.php index d06d0a2..c160fb6 100644 --- a/app/traits/cms/MenuTrait.php +++ b/app/traits/cms/MenuTrait.php @@ -64,10 +64,21 @@ trait MenuTrait $name = $name.':index'; } + if (!in_array($name, $rules)) { + unset($menus[$k]); + } + }else{ + $name = $m['name']; + $nameArr = explode(':', $name); + if (count($nameArr) <= 1) { + $name = $name.':index'; + } + if (!in_array($name, $rules)) { unset($menus[$k]); } } + } return $menus; } diff --git a/view/manager/business/index.html b/view/manager/business/index.html index dc0bd6d..a22d053 100644 --- a/view/manager/business/index.html +++ b/view/manager/business/index.html @@ -55,7 +55,9 @@ 扣费记录 充值记录 基本资料 + {if $isAdmin} 指派代理商 + {/if} 下载核销二维码 代为充值