更新店铺距离
This commit is contained in:
parent
8f3dea51fb
commit
cc66772c66
@ -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;
|
||||
}
|
||||
|
@ -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']);
|
||||
|
Loading…
x
Reference in New Issue
Block a user