From 6a01d9a1a34606a1db4454cc171c33cd9a78fb14 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 9 Nov 2023 20:42:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/system/merchant/MerchantRepository.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/common/repositories/system/merchant/MerchantRepository.php b/app/common/repositories/system/merchant/MerchantRepository.php index d0b465b7..f991bff2 100644 --- a/app/common/repositories/system/merchant/MerchantRepository.php +++ b/app/common/repositories/system/merchant/MerchantRepository.php @@ -306,6 +306,7 @@ class MerchantRepository extends BaseRepository 'lat' => (float)$data[0], 'long' => (float)$data[1], ]; + $where['order']='location'; } } if ($where['keyword'] !== '') { @@ -316,7 +317,7 @@ class MerchantRepository extends BaseRepository $status = systemConfig('mer_location'); /** @var MerchantTakeRepository $repository */ $repository = app()->make(MerchantTakeRepository::class); - $list = $query->page($page, 100)->setOption('field', [])->field($field)->select() + $list = $query->page($page, $limit)->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']);