diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index b9ba36d5..6ccf1b76 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -69,6 +69,42 @@ class StoreSpu extends BaseController return app('json')->success($data); } + /** + * TODO 商品搜索列表 + * @return mixed + * @author Qinii + * @day 12/24/20 + */ + public function streetLst($id) + { + [$page, $limit] = $this->getPage(); + $where = $this->request->params([ + 'keyword', + 'cate_id', + 'cate_pid', + 'order', + 'price_on', + 'price_off', + 'brand_id', + 'pid', + 'mer_cate_id', + 'product_type', + 'action', + 'common', + 'is_trader', + 'product_ids', + 'mer_id' + ]); + $where['is_gift_bag'] = 0; + $where['product_type'] = 0; + $where['order'] = $where['order'] ?: 'star'; + $where['mer_ids'] = Merchant::getInstance()->where('type_id', Merchant::TypeStore)->where('street_id', $id) + ->where(['status' => 1, 'mer_state' => 1, 'is_del' => 0])->column('mer_id'); + if ($where['is_trader'] != 1) unset($where['is_trader']); + $data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo); + return app('json')->success($data); + } + /** * TODO 商户的商品搜索列表 * @param $id diff --git a/route/api.php b/route/api.php index 43b54c61..15d8f715 100644 --- a/route/api.php +++ b/route/api.php @@ -475,6 +475,8 @@ Route::group('api/', function () { Route::group('product/spu', function () { //礼包 product/spu/bag Route::get('/bag', 'StoreSpu/bag'); + //商品 product/spu/street/:id + Route::get('/street/:id', 'StoreSpu/streetLst'); //商品 product/spu/lst Route::get('/lst', 'StoreSpu/lst'); //热门 product/spu/hot/:type