|
|
@@ -45,8 +45,8 @@ class ServiceOrderLogic extends BaseLogic
|
|
|
foreach ($rules as $key=>$value){
|
|
|
$rule = explode(',',$value);
|
|
|
//$masters[] = ['id'=>$key,'lon'=>$rule[0],'lat'=>$rule[1],'radius'=>$rule[2]];
|
|
|
- $distance = DistributeLeafletsService::haversineDistance($params['lat'], $params['lon'], $rule[1], $rule[0]);
|
|
|
- if($distance <= $value[2]){
|
|
|
+ $distance = round(DistributeLeafletsService::haversineDistance($params['lat'], $params['lon'], $rule[1], $rule[0]), 2);
|
|
|
+ if($distance <= (float)$rule[2]){
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
@@ -65,7 +65,7 @@ class ServiceOrderLogic extends BaseLogic
|
|
|
try {
|
|
|
// 订单位置是否在服务区内
|
|
|
if(!self::isService($params)){
|
|
|
- //throw new Exception('已超出服务区域!');
|
|
|
+ throw new Exception('已超出服务区域!');
|
|
|
}
|
|
|
$goods = Goods::findOrEmpty($params['goods_id']);
|
|
|
if($goods->isEmpty()){
|