Explorar o código

菜单列表优化

wufeng %!s(int64=2) %!d(string=hai) anos
pai
achega
7707bf5e39
Modificáronse 1 ficheiros con 8 adicións e 3 borrados
  1. 8 3
      app/admin/controller/Menu.php

+ 8 - 3
app/admin/controller/Menu.php

@@ -75,9 +75,14 @@ class Menu extends BaseController{
         if($role==false){
             return app_show(0,"获取成功",[]);
         }
-       $data = Db::name("admin_menu")->where([["is_del","=",0],["level",">=",$this->level]])->field("id,menu_name,menu_img,menu_route,menu_url,pid,is_show,is_private,menu_type,level,status,weight")->order("weight desc,id asc")->select();
-        $l= MenuTree($data,0);
-        return app_show(0,"获取成功",$l);
+         $data = Db::name("admin_menu")
+             ->where([["is_del", "=", 0]])
+             ->field("id,menu_name,menu_img,menu_route,menu_url,pid,is_show,is_private,menu_type,level,status,weight")
+             ->order("weight desc,id asc")
+             ->select()
+             ->toArray();
+         $l = MenuTree($data, 0);
+         return app_show(0, "获取成功", $l);
     }
 
      /**