添加商品分类查询
This commit is contained in:
parent
515338aa89
commit
363df36c3d
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user