瀏覽代碼

fix:增加一个全部分类接口

super-yimizi 3 月之前
父節點
當前提交
5c6a29ca53
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      application/api/controller/Category.php

+ 11 - 0
application/api/controller/Category.php

@@ -25,4 +25,15 @@ class Category extends Base
 
         $this->success('获取成功', $list);
     }
+
+    //  查询所有分类
+    public function getCategoryList()
+    {       
+        $categoryList = CategoryModel::field('id,pid,name,image')
+        ->order('weigh asc,id asc')
+        ->where('status',StatusEnum::ENABLED)
+        ->select();
+       
+        $this->success('获取成功', $categoryList);
+    }
 }