新增根据街道id查询商品
This commit is contained in:
parent
05fc330d93
commit
72a0194421
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user