瀏覽代碼

大屏幕接口

lizhen_gitee 7 月之前
父節點
當前提交
3487f23a56
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      application/common/library/Authcompany.php

+ 7 - 7
application/common/library/Authcompany.php

@@ -580,25 +580,25 @@ class Authcompany extends \fast\Authpc
 
         // 必须将结果集转换为数组
         $ruleList = collection(\app\admin\model\PcAuthRule::where('status', 'normal')
-            ->field('id,pid as parentId,name as namerule,title as name,path,component,component_name as componentName,icon')
-            ->where('type',2)->where('pid',0)
+            ->field('id,pid as parentId,name as namerule,title as name,path,component,component_name as componentName,icon,visible,alwaysShow,keepAlive')
+            ->where('type',1)->where('pid',0)
             ->order('weigh', 'desc')
             ->select())->toArray();
 
         foreach ($ruleList as $k => &$v) {
-            $v['alwaysShow'] = true;
-            $v['keepAlive']  = true;
-            $v['visible']    = true;
+            $v['visible']    = $v['visible'] == 1 ? true : false;
+            $v['alwaysShow'] = $v['alwaysShow'] == 1 ? true : false;
+            $v['keepAlive']  = $v['keepAlive'] == 1 ? true : false;
 
             if (!in_array($v['namerule'], $userRule)) {
                 unset($ruleList[$k]);
                 continue;
             }
         }
-        return $ruleList;
+//        return $ruleList;
 //        dump($ruleList);
         Tree::instance()->init($ruleList,'parentId');
-        $menu = Tree::instance()->getTreeArray(0);
+        $menu = Tree::instance()->getTreeArray_2(0);
 //        dump($menu);
         return $menu;
     }