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