From 6964f16a1fdec1078e447937e2bc747c54c1fee1 Mon Sep 17 00:00:00 2001 From: limu <610543851@qq.com> Date: Fri, 15 Dec 2023 22:07:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=81=E5=B8=82=E5=8C=BA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/admin/store/StoreBrand.php | 9 ++++++++- route/admin/product.php | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/controller/admin/store/StoreBrand.php b/app/controller/admin/store/StoreBrand.php index 3d4558a..bec0814 100644 --- a/app/controller/admin/store/StoreBrand.php +++ b/app/controller/admin/store/StoreBrand.php @@ -16,6 +16,7 @@ use think\App; use crmeb\basic\BaseController; use app\validate\admin\StoreBrandValidate as validate; use app\common\repositories\store\StoreBrandRepository; +use app\common\repositories\store\CityAreaRepository; class StoreBrand extends BaseController { @@ -141,7 +142,13 @@ class StoreBrand extends BaseController public function all() { - $data = $this->repository->getAll(); + $data = $this->repository->getAll(); return app('json')->success($data); } + + public function getCitylist($id,CityAreaRepository $repository) + { + $where['parent_id'] = $id; + return app('json')->success($repository->getList($where)); + } } diff --git a/route/admin/product.php b/route/admin/product.php index 0da4320..39b71d4 100644 --- a/route/admin/product.php +++ b/route/admin/product.php @@ -153,6 +153,9 @@ Route::group(function () { Route::get('brandList', '/all')->name('systemStoreBrandAll')->option([ '_alias' => '列表', ]); + Route::get('city/:id', '/getCitylist')->name('systemStoreCity')->option([ + '_alias' => '列表', + ]); Route::post('status/:id', '/switchStatus')->name('systemStoreBrandSwithStatus')->option([ '_alias' => '修改状态', ]);