This commit is contained in:
mkm 2023-11-15 15:34:53 +08:00
parent 8f230c7b43
commit b6cf29edf5

View File

@ -58,10 +58,20 @@ class Merchant extends BaseController
public function lst()
{
[$page, $limit] = $this->getPage();
$where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id', 'type_code', 'is_trader', 'street_id', 'credit_buy']);
$where = $this->request->params(['store_category_id','keyword', 'order', 'is_best', 'location', 'category_id', 'type_id', 'type_code', 'is_trader', 'street_id', 'credit_buy']);
if (empty($where['type_id'])) {
$where['type_id'] =[10,17];
}
if($where['store_category_id']>0){
$arr= Db::name('store_category')->where(['pid'=>$where['store_category_id'],'mer_id'=>0,'level'=>1,'is_show'=>1])->column('cate_name');
if($arr){
$category_id=Db::name('merchant_category')->whereIn('category_name',$arr)->column('merchant_category_id');
if($category_id){
$where['category_id']=explode(',',$category_id);
}
}
unset($where['store_category_id']);
}
return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo));
}