更新
This commit is contained in:
parent
25c31503e5
commit
cb6dfe58f9
@ -331,12 +331,12 @@ class MerchantDao extends BaseDao
|
||||
->whereNotNull('long')
|
||||
->field("mer_id,st_distance_sphere(point(`long`,`lat`), point({$lng}, {$lat})) as distance");
|
||||
if ($sort) {
|
||||
$query->order('distance')->limit(20);
|
||||
$query->order('distance')->limit(100);
|
||||
} else {
|
||||
$query->having("distance <= {$distance}")->limit(50);
|
||||
}
|
||||
$merchant = $query->select();
|
||||
if (empty($merchant) && $distance < 5000 && !$sort) {
|
||||
$merchant = $query->select()->toArray();
|
||||
if (empty($merchant) && $distance < 50000 && !$sort) {
|
||||
$merchant = $this->getValidMerchantByDistance($lat, $lng, $sort, 50000);
|
||||
}
|
||||
if (!empty($merchant)) {
|
||||
|
@ -59,7 +59,7 @@ class CloudWarehouse extends BaseController
|
||||
}
|
||||
}
|
||||
if (!empty($lat)) {
|
||||
$merIds = (new MerchantDao())->getValidMerchantByDistance($lat, $lng);
|
||||
$merIds = (new MerchantDao())->getValidMerchantByDistance($lat, $lng,true,50000);
|
||||
if (!empty($merIds)) {
|
||||
$query->whereIn('mer_id', $merIds);
|
||||
}
|
||||
@ -75,7 +75,7 @@ class CloudWarehouse extends BaseController
|
||||
$query->whereIn('cate_id', $cate_id);
|
||||
}
|
||||
$cloud_product_arr = $query->where(function($query){
|
||||
$query->whereOr('mer_labels', '')
|
||||
$query->where('mer_labels', '')
|
||||
->whereOr('mer_labels',',5,');
|
||||
})->page($page)->field('product_id,mer_labels')->select();
|
||||
$cloud_product = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user