商户按地址搜索
This commit is contained in:
parent
6cb8a607fe
commit
312b49b440
@ -52,6 +52,10 @@ class MerchantDao extends BaseDao
|
||||
->when(isset($where['is_trader']) && $where['is_trader'] !== '', function ($query) use ($where) {
|
||||
$query->where('is_trader', $where['is_trader']);
|
||||
})
|
||||
->when(isset($where['street_id']) && $where['street_id'] !== '', function ($query) use ($where) {
|
||||
$mer_id = Db::name('merchant_address')->where('street_id', $where['street_id'])->column('mer_id');
|
||||
$query->whereIn('mer_id',$mer_id ?: '' );
|
||||
})
|
||||
->when(isset($where['is_best']) && $where['is_best'] !== '', function ($query) use ($where) {
|
||||
$query->where('is_best', $where['is_best']);
|
||||
})
|
||||
|
@ -42,7 +42,7 @@ class Merchant extends BaseController
|
||||
public function lst()
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
$where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id','is_trader']);
|
||||
$where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id','is_trader','street_id']);
|
||||
return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user