API APP DOCTOR

This commit is contained in:
ivan-sim
2024-04-23 16:28:59 +07:00
parent 2cf00ac927
commit 1cb3b2d3f0
15 changed files with 811 additions and 10 deletions

View File

@@ -391,9 +391,7 @@ class Helper
$mail->send();
return true;
} catch (\Exception $e) {
dd($e);
return ($mail->ErrorInfo);
return false;
return $mail->ErrorInfo;
}
}
@@ -463,16 +461,16 @@ class Helper
$lonFrom = deg2rad($longitudeFrom);
$latTo = deg2rad($latitudeTo);
$lonTo = deg2rad($longitudeTo);
// Calculate the change in coordinates
$deltaLat = $latTo - $latFrom;
$deltaLon = $lonTo - $lonFrom;
// Apply Haversine formula
$a = sin($deltaLat / 2) * sin($deltaLat / 2) + cos($latFrom) * cos($latTo) * sin($deltaLon / 2) * sin($deltaLon / 2);
$c = 2 * atan2(sqrt($a), sqrt(1 - $a));
$distance = $earthRadius * $c;
return $distance;
}