wugg 8 months ago
parent
commit
516208680e
2 changed files with 3 additions and 3 deletions
  1. 2 2
      app/admin/controller/Base.php
  2. 1 1
      app/admin/controller/Menu.php

+ 2 - 2
app/admin/controller/Base.php

@@ -79,8 +79,8 @@ class Base extends \app\BaseController
             }
             $action = [];
             $this->roleid = $uid['roleid'];
-            $role = Db::name("role_action")->where(["role_id" => $uid['roleid'], "status" => 1])->find();
-            $action['action_conllect'] = isset($role['action_conllect']) ? $role['action_conllect'] : '';
+            $role = Db::name("role_action")->where(["role_id" => $uid['roleid'], "status" => 1])->json(["action_conllect"])->find();
+            $action['action_conllect'] = isset($role['action_conllect']) ? implode(",", $role['action_conllect']) :"";
             $action['write'][] = $this->uid;
             $group = [];
             $group = Db::name("role_group")->where("FIND_IN_SET($this->uid,group_user) > 0")->column("id");

+ 1 - 1
app/admin/controller/Menu.php

@@ -55,7 +55,7 @@ class Menu extends Base
             if ($this->level == 1) $where[] = ['blevel', 'in', [0, 1, 2]];
             else $where[] = ['blevel', 'in', [0, $this->level]];
         }
-        $roleaction = json_decode($role['action_conllect'],true);
+        $roleaction =  is_array($role['action_conllect'])?$role['action_conllect']:json_decode($role['action_conllect'],true);
         $data = Db::name("view_menu")
             ->where($where)
             ->whereIn('aid', $roleaction)