diff --git a/app/common/dao/system/merchant/MerchantDao.php b/app/common/dao/system/merchant/MerchantDao.php index 5b102152..e6eaa89b 100644 --- a/app/common/dao/system/merchant/MerchantDao.php +++ b/app/common/dao/system/merchant/MerchantDao.php @@ -103,8 +103,9 @@ class MerchantDao extends BaseDao }); } } - if (isset($where['status']) && $where['status'] !== '') + if (isset($where['status']) && $where['status'] !== ''){ $query->where('status', $where['status']); + } $order = $where['order'] ?? ''; $query->when($order, function ($query) use ($where, $order) { if ($order == 'rate') { @@ -123,8 +124,8 @@ class MerchantDao extends BaseDao $query->order('is_best DESC, sales DESC,sort DESC'); } }, function ($query) use ($order) { - // $query->order('is_best DESC, sort DESC,sales DESC'); - $query->order('mer_id DESC'); + $query->order('is_best DESC, sort DESC,sales DESC'); + // $query->order('mer_id DESC'); }); return $query; } diff --git a/app/common/repositories/system/merchant/MerchantRepository.php b/app/common/repositories/system/merchant/MerchantRepository.php index 38233e4e..d0b465b7 100644 --- a/app/common/repositories/system/merchant/MerchantRepository.php +++ b/app/common/repositories/system/merchant/MerchantRepository.php @@ -316,7 +316,7 @@ class MerchantRepository extends BaseRepository $status = systemConfig('mer_location'); /** @var MerchantTakeRepository $repository */ $repository = app()->make(MerchantTakeRepository::class); - $list = $query->page($page, $limit)->setOption('field', [])->field($field)->select() + $list = $query->page($page, 100)->setOption('field', [])->field($field)->select() ->each(function ($item) use ($status, $where, $repository) { if ($status && $item['lat'] && $item['long'] && isset($where['location']['lat'], $where['location']['long'])) { $distance = getDistance($where['location']['lat'], $where['location']['long'], $item['lat'], $item['long']);