更新查询
This commit is contained in:
parent
e4847c0e7e
commit
1d74ee6265
@ -42,8 +42,6 @@ class StoreSpu extends BaseController
|
|||||||
public function lst()
|
public function lst()
|
||||||
{
|
{
|
||||||
[$page, $limit] = $this->getPage();
|
[$page, $limit] = $this->getPage();
|
||||||
// 除了市级供应链都可以查询
|
|
||||||
$typeIdArray = Db::name('MerchantType')->whereNotIn('type_code', (string)Merchant::TypeCode['TypeSupplyChain'])->column('mer_type_id');
|
|
||||||
$where = $this->request->params([
|
$where = $this->request->params([
|
||||||
'keyword',
|
'keyword',
|
||||||
'cate_id',
|
'cate_id',
|
||||||
@ -59,12 +57,18 @@ class StoreSpu extends BaseController
|
|||||||
'common',
|
'common',
|
||||||
'is_trader',
|
'is_trader',
|
||||||
'product_ids',
|
'product_ids',
|
||||||
'mer_id'
|
'mer_id',
|
||||||
|
'type_id'
|
||||||
]);
|
]);
|
||||||
|
if($where['type_id']){
|
||||||
|
$where['mer_ids'] = Merchant::getInstance()->whereIn('type_id', implode(',', $where['type_id']))->where(['status' => 1, 'mer_state' => 1, 'is_del' => 0])->column('mer_id');
|
||||||
|
}else{
|
||||||
|
unset($where['type_id']);
|
||||||
|
}
|
||||||
$where['is_gift_bag'] = 0;
|
$where['is_gift_bag'] = 0;
|
||||||
$where['product_type'] = 0;
|
$where['product_type'] = 0;
|
||||||
$where['order'] = $where['order'] ?: 'star';
|
$where['order'] = $where['order'] ?: 'star';
|
||||||
$where['mer_ids'] = Merchant::getInstance()->whereIn('type_id', implode(',', $typeIdArray ?? []))->where(['status' => 1, 'mer_state' => 1, 'is_del' => 0])->column('mer_id');
|
halt($where);
|
||||||
if ($where['is_trader'] != 1) unset($where['is_trader']);
|
if ($where['is_trader'] != 1) unset($where['is_trader']);
|
||||||
$data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo);
|
$data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo);
|
||||||
return app('json')->success($data);
|
return app('json')->success($data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user