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' => '修改状态', ]);