更新查询

This commit is contained in:
mkm 2023-11-08 15:11:22 +08:00
parent e4847c0e7e
commit 1d74ee6265

View File

@ -42,8 +42,6 @@ class StoreSpu extends BaseController
public function lst()
{
[$page, $limit] = $this->getPage();
// 除了市级供应链都可以查询
$typeIdArray = Db::name('MerchantType')->whereNotIn('type_code', (string)Merchant::TypeCode['TypeSupplyChain'])->column('mer_type_id');
$where = $this->request->params([
'keyword',
'cate_id',
@ -59,12 +57,18 @@ class StoreSpu extends BaseController
'common',
'is_trader',
'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['product_type'] = 0;
$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']);
$data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo);
return app('json')->success($data);