git лет назад: 5
Родитель
Сommit
d300134c94
2 измененных файлов с 9 добавлено и 1 удалено
  1. 7 1
      Home/Lib/Action/ApiAction.class.php
  2. 2 0
      Home/Lib/Action/CronAction.class.php

+ 7 - 1
Home/Lib/Action/ApiAction.class.php

@@ -776,6 +776,11 @@ class ApiAction extends Action {
 		$lat2 = floatval($lat2) * $rad;
 		$lng2 = floatval($lng2) * $rad;
 		
+		$lat1 = sprintf("%.8f", $lat1);
+		$lng1 = sprintf("%.8f", $lng1);
+		$lat2 = sprintf("%.8f", $lat2);
+		$lng2 = sprintf("%.8f", $lng2);
+		
 		$theta = $lng2 - $lng1;
 		
 		$dist = acos(sin($lat1) * sin($lat2) +
@@ -787,7 +792,8 @@ class ApiAction extends Action {
 			$dist += M_PI;
 		}
 		
-		return $dist = $dist * $radius;
+		$dist = $dist * $radius;
+		return sprintf('%.8f', $dist);
 	}
 	
  

+ 2 - 0
Home/Lib/Action/CronAction.class.php

@@ -363,6 +363,7 @@ class CronAction extends Action {
 			echo "DetailedAdd empty!".PHP_EOL;
 			return false;
 		}
+		/*
 		$cjh = $params['FrameNumber'];
 		if(!$cjh){
 			echo "FrameNumber empty!".PHP_EOL;
@@ -373,6 +374,7 @@ class CronAction extends Action {
 			echo "MotorNumber empty!".PHP_EOL;
 			return false;
 		}
+		*/
 		$cph = $params['VehicleBrand'];
 		if(!$cph){
 			echo "VehicleBrand empty!".PHP_EOL;