feat: 增加经纬度判断逻辑

This commit is contained in:
mkm 2024-07-01 09:25:33 +08:00
parent f3f5fa705f
commit a1504ba090

View File

@ -168,7 +168,7 @@ class OrderLogic extends BaseLogic
} }
//处理返回最近的店铺 //处理返回最近的店铺
$store['near_store'] = []; $store['near_store'] = [];
if($params['lat'] && $params['long']){ if((isset($params['lat'])&&$params['lat']!='')&&(isset($params['long']) &&$params['lat']!='')){
$storeAll = SystemStore::field('id,name,phone,address,detailed_address,latitude,longitude')->select()->toArray(); $storeAll = SystemStore::field('id,name,phone,address,detailed_address,latitude,longitude')->select()->toArray();
$nearestStore = null; $nearestStore = null;
$minDistance = PHP_FLOAT_MAX; $minDistance = PHP_FLOAT_MAX;