省市区接口

main
limu 1 year ago
parent b631520f57
commit 6964f16a1f
  1. 9
      app/controller/admin/store/StoreBrand.php
  2. 3
      route/admin/product.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));
}
}

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

Loading…
Cancel
Save