浏览代码

菜单列表不显示接口

evoxwht 2 年之前
父节点
当前提交
4c364fddd0
共有 2 个文件被更改,包括 10 次插入1 次删除
  1. 7 0
      crmeb/app/adminapi/controller/v1/setting/SystemMenus.php
  2. 3 1
      crmeb/app/model/system/SystemMenus.php

+ 7 - 0
crmeb/app/adminapi/controller/v1/setting/SystemMenus.php

@@ -40,12 +40,19 @@ class SystemMenus extends AuthController
     /**
      * 菜单展示列表
      * @return \think\Response
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/05/06
      */
     public function index()
     {
         $where = $this->request->getMore([
             ['is_show', ''],
             ['keyword', ''],
+            ['auth_type', ''],
         ]);
         return app('json')->success($this->services->getList($where));
     }

+ 3 - 1
crmeb/app/model/system/SystemMenus.php

@@ -231,6 +231,8 @@ class SystemMenus extends BaseModel
      */
     public function searchAuthTypeAttr($query, $value)
     {
-        $query->where('auth_type', $value);
+        if ($value !== '') {
+            $query->where('auth_type', $value);
+        }
     }
 }