Преглед на файлове

Merge branch 'bug_fix_1212_liu'

rkljw преди 3 месеца
родител
ревизия
6812a8a263
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      app/JsonRpc/AuthorityService.php

+ 5 - 1
app/JsonRpc/AuthorityService.php

@@ -18,7 +18,11 @@ class AuthorityService implements AuthorityServiceInterface
      */
     public function getMenuList(array $data): array
     {
-        $result = Menu::get();
+        $where = [];
+        if(isset($data['id']) && $data['id']){
+            array_push($where,['pid','=',$data['id']]);
+        }
+        $result = Menu::where($where)->get();
         if (empty($result)) {
             return Result::error("没有菜单",0,[]);
         }