正在显示
1 个修改的文件
包含
26 行增加
和
18 行删除
| @@ -28,13 +28,9 @@ class ComController extends BaseController | @@ -28,13 +28,9 @@ class ComController extends BaseController | ||
| 28 | //根据当前登录用户角色返回用户菜单列表 | 28 | //根据当前登录用户角色返回用户菜单列表 |
| 29 | $projectMenuModel = new ProjectMenuModel(); | 29 | $projectMenuModel = new ProjectMenuModel(); |
| 30 | if($this->user['role_id'] != 0){ | 30 | if($this->user['role_id'] != 0){ |
| 31 | - $this->map = $this->getRoleMenuList(); | 31 | + $this->map = $this->getNoAdminMenuCondition(); |
| 32 | }else{ | 32 | }else{ |
| 33 | - $this->map['status'] = 0; | ||
| 34 | - $code = $this->getIsHome(); | ||
| 35 | - if($code == 0){ | ||
| 36 | - $this->map['id'] = ['!=',11]; | ||
| 37 | - } | 33 | + $this->map = $this->getAdminMenuCondition(); |
| 38 | } | 34 | } |
| 39 | $lists = $projectMenuModel->list($this->map,'sort'); | 35 | $lists = $projectMenuModel->list($this->map,'sort'); |
| 40 | $menu = array(); | 36 | $menu = array(); |
| @@ -69,12 +65,12 @@ class ComController extends BaseController | @@ -69,12 +65,12 @@ class ComController extends BaseController | ||
| 69 | * @method :post | 65 | * @method :post |
| 70 | * @time :2023/9/6 11:47 | 66 | * @time :2023/9/6 11:47 |
| 71 | */ | 67 | */ |
| 72 | - public function getRoleMenuList(){ | 68 | + public function getNoAdminMenuCondition(){ |
| 73 | $code = $this->getIsHome(); | 69 | $code = $this->getIsHome(); |
| 74 | $projectRoleModel = new ProjectRoleModel(); | 70 | $projectRoleModel = new ProjectRoleModel(); |
| 75 | $info = $projectRoleModel->read(['id'=>$this->user['role_id']]); | 71 | $info = $projectRoleModel->read(['id'=>$this->user['role_id']]); |
| 76 | if($code != 0){ | 72 | if($code != 0){ |
| 77 | - $info['role_menu'] = trim(str_replace(',11,','',','.$info['role_menu'].','),','); | 73 | + $info['role_menu'] = trim(str_replace(',11,',',',','.$info['role_menu'].','),','); |
| 78 | } | 74 | } |
| 79 | $this->map = [ | 75 | $this->map = [ |
| 80 | 'status'=>0, | 76 | 'status'=>0, |
| @@ -84,6 +80,22 @@ class ComController extends BaseController | @@ -84,6 +80,22 @@ class ComController extends BaseController | ||
| 84 | return $this->map; | 80 | return $this->map; |
| 85 | } | 81 | } |
| 86 | 82 | ||
| 83 | + /** | ||
| 84 | + * @remark :超级管理员菜单列表 | ||
| 85 | + * @name :getAdminMenuCondition | ||
| 86 | + * @author :lyh | ||
| 87 | + * @method :post | ||
| 88 | + * @time :2023/9/6 13:53 | ||
| 89 | + */ | ||
| 90 | + public function getAdminMenuCondition(){ | ||
| 91 | + $this->map['status'] = 0; | ||
| 92 | + $code = $this->getIsHome(); | ||
| 93 | + if($code == 0){ | ||
| 94 | + $this->map['id'] = ['!=',11];//排除菜单网站装修 | ||
| 95 | + } | ||
| 96 | + return $this->map; | ||
| 97 | + } | ||
| 98 | + | ||
| 87 | 99 | ||
| 88 | /** | 100 | /** |
| 89 | * @remark :查看是否显示网站装饰 | 101 | * @remark :查看是否显示网站装饰 |
| @@ -95,17 +107,13 @@ class ComController extends BaseController | @@ -95,17 +107,13 @@ class ComController extends BaseController | ||
| 95 | public function getIsHome(){ | 107 | public function getIsHome(){ |
| 96 | $deployBuild = new DeployBuild(); | 108 | $deployBuild = new DeployBuild(); |
| 97 | $info = $deployBuild->read(['project_id'=>$this->user['project_id']]); | 109 | $info = $deployBuild->read(['project_id'=>$this->user['project_id']]); |
| 98 | - if(empty($info['configuration'])){ | ||
| 99 | - return 0; | ||
| 100 | - } | ||
| 101 | - $configuration = Arr::s2a($info['configuration']); | ||
| 102 | - if(!isset($configuration['is_home'])){ | ||
| 103 | - return 0; | ||
| 104 | - } | ||
| 105 | - if(($configuration['is_home'] == 0)){ | ||
| 106 | - return 0; | 110 | + if(!empty($info['configuration'])){ |
| 111 | + $configuration = Arr::s2a($info['configuration']); | ||
| 112 | + if(isset($configuration['is_home']) && ($configuration['is_home'] != 0)){ | ||
| 113 | + return 1; | ||
| 114 | + } | ||
| 107 | } | 115 | } |
| 108 | - return 1; | 116 | + return 0; |
| 109 | } | 117 | } |
| 110 | 118 | ||
| 111 | /** | 119 | /** |
-
请 注册 或 登录 后发表评论