Merge pull request 'preview' (#72) from preview into master

Reviewed-on: #72
This commit is contained in:
mkm 2023-11-09 20:43:09 +08:00
commit 6327ccd984

View File

@ -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']);