sugangqiang 2 năm trước cách đây
mục cha
commit
d827645a3d
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      app/common/api/MenuApi.php

+ 4 - 1
app/common/api/MenuApi.php

@@ -92,6 +92,7 @@ class MenuApi {
         if ($role) {
             $menu_ids = $role->sysRelation->column("menuid");
             $where[] = ["status", "=", 1];
+            $where[] = ["delete", "=", 0];
             $where[] = ["ismenu", "=", 1];
             $where[] = ["new_url", "<>", ""];
             $where[] = ["id", "in", $menu_ids];
@@ -115,7 +116,9 @@ class MenuApi {
     public static function getPrivilagesByRoleid($roleid) {
         $role = Role::find($roleid);
         $menu_ids = $role->sysRelation->column("menuid");
-        $menus = Menu::where("status", 1)->order("levels asc,num asc")->select()->toArray();
+        $where[] = ["status", '=', 1];
+        $where[] = ["delete", '=', 0];
+        $menus = Menu::where($where)->order("levels asc,num asc")->select()->toArray();
         $codeToPid = [];
         foreach ($menus as &$menu) {
             $codeToPid[$menu["code"]] = $menu["id"];