From 363df36c3debfcd8a5998677098df69ac2eb8247 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Thu, 14 Mar 2024 15:03:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/store/product/StoreCategory.php | 15 +++++++++++++++ route/api.php | 1 + 2 files changed, 16 insertions(+) diff --git a/app/controller/api/store/product/StoreCategory.php b/app/controller/api/store/product/StoreCategory.php index c20a5ea5..807ef981 100644 --- a/app/controller/api/store/product/StoreCategory.php +++ b/app/controller/api/store/product/StoreCategory.php @@ -12,6 +12,7 @@ namespace app\controller\api\store\product; +use app\common\dao\store\StoreCategoryDao; use think\App; use crmeb\basic\BaseController; use app\common\repositories\store\StoreCategoryRepository as repository; @@ -76,4 +77,18 @@ class StoreCategory extends BaseController ])->order('sort DESC,create_time DESC')->select(); return app('json')->success($data); } + + /** + * @return mixed + */ + public function index() + { + $pid = $this->request->get('pid', 0); + $merId = $this->request->get('mer_id', 0); + /** @var StoreCategoryDao $dao */ + $dao = app()->make(StoreCategoryDao::class); + $data = $dao->children($pid, $merId); + return app('json')->success($data); + } + } diff --git a/route/api.php b/route/api.php index 1379e431..645c5fa0 100644 --- a/route/api.php +++ b/route/api.php @@ -438,6 +438,7 @@ Route::group('api/', function () { Route::get('seckill/detail/:id', 'StoreProductSeckill/detail')->middleware(VisitProductMiddleware::class, 1); Route::get('category/lst', 'StoreCategory/lst'); Route::get('category', 'StoreCategory/children'); + Route::get('category/index', 'StoreCategory/index'); Route::get('brand/lst', 'StoreBrand/lst'); Route::get('detail/:id', 'StoreProduct/detail')->middleware(VisitProductMiddleware::class, 0); Route::get('show/:id', 'StoreProduct/show');