商户列表添加区域检索

This commit is contained in:
luofei 2023-06-05 17:17:43 +08:00
parent 86f069e6a7
commit 76f9fcbbb1
2 changed files with 4 additions and 1 deletions

View File

@ -52,6 +52,9 @@ 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['area_id']) && $where['area_id'] !== '', function ($query) use ($where) {
$query->where('area_id', $where['area_id']);
})
->when(isset($where['street_id']) && $where['street_id'] !== '', function ($query) use ($where) {
$query->where('street_id', $where['street_id']);
})

View File

@ -72,7 +72,7 @@ class Merchant extends BaseController
public function lst()
{
[$page, $limit] = $this->getPage();
$where = $this->request->params(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id']);
$where = $this->request->params(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id', 'area_id', 'street_id']);
return app('json')->success($this->repository->lst($where, $page, $limit));
}