作者 赵彬吉

update

@@ -33,14 +33,17 @@ class ComController extends BaseController @@ -33,14 +33,17 @@ class ComController extends BaseController
33 $this->map = $this->getAdminMenuCondition(); 33 $this->map = $this->getAdminMenuCondition();
34 } 34 }
35 $lists = $projectMenuModel->list($this->map,'sort'); 35 $lists = $projectMenuModel->list($this->map,'sort');
36 - $menu = array();  
37 foreach ($lists as $k => $v){ 36 foreach ($lists as $k => $v){
38 $v = (array)$v; 37 $v = (array)$v;
39 if(empty($this->user['is_upload_manage'])){ 38 if(empty($this->user['is_upload_manage'])){
40 if($v['rules'] == '/fileUpload'){ 39 if($v['rules'] == '/fileUpload'){
41 - continue; 40 + unset($lists[$k]);
  41 + }
42 } 42 }
43 } 43 }
  44 + $menu = array();
  45 + foreach ($lists as $k => $v){
  46 + $v = (array)$v;
44 if ($v['pid'] == 0) { 47 if ($v['pid'] == 0) {
45 $v['sub'] = _get_child($v['id'], $lists); 48 $v['sub'] = _get_child($v['id'], $lists);
46 $menu[] = $v; 49 $menu[] = $v;
@@ -28,14 +28,17 @@ class RoleLogic extends BaseLogic @@ -28,14 +28,17 @@ class RoleLogic extends BaseLogic
28 $menuModel = new ProjectMenuModel(); 28 $menuModel = new ProjectMenuModel();
29 //根据当前登录用户角色返回用户菜单列表 29 //根据当前登录用户角色返回用户菜单列表
30 $lists = $menuModel->where(['status'=>0])->get()->toArray(); 30 $lists = $menuModel->where(['status'=>0])->get()->toArray();
31 - $menu = array();  
32 - foreach ($lists as $v){ 31 + foreach ($lists as $k => $v){
33 $v = (array)$v; 32 $v = (array)$v;
34 if(empty($this->user['is_upload_manage'])){ 33 if(empty($this->user['is_upload_manage'])){
35 if($v['rules'] == '/fileUpload'){ 34 if($v['rules'] == '/fileUpload'){
36 - continue; 35 + unset($lists[$k]);
  36 + }
37 } 37 }
38 } 38 }
  39 + $menu = array();
  40 + foreach ($lists as $v){
  41 + $v = (array)$v;
39 if ($v['pid'] == 0) { 42 if ($v['pid'] == 0) {
40 $v['sub'] = _get_child($v['id'], $lists); 43 $v['sub'] = _get_child($v['id'], $lists);
41 $menu[] = $v; 44 $menu[] = $v;