Browse Source

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

super-yimizi 2 months ago
parent
commit
5c6a29ca53
1 changed files with 11 additions and 0 deletions
  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);
+    }
 }