Update: 2026-07-06 02:07:30

This commit is contained in:
Hamza-Ayed
2026-07-06 02:07:30 +03:00
parent 8d9126bb45
commit ac50598ee0
4 changed files with 22 additions and 3 deletions
+3 -2
View File
@@ -165,6 +165,7 @@ function calculateDynamicPrice($country, $minFare, $distance, $duration, $kazanR
$heavyPrice = (float) ($kazanRow['peakMinPrice'] ?? 0);
$latePrice = (float) ($kazanRow['lateMinPrice'] ?? 0);
$kazanPercent = (float) ($kazanRow['kazanPercent'] ?? 10);
$startPrice = (float) ($kazanRow['startPrice'] ?? 0);
// === General Settings ===
$minBillableKm = 0.2;
@@ -268,11 +269,11 @@ function calculateDynamicPrice($country, $minFare, $distance, $duration, $kazanR
$baseFareForDistance = $billableDistance * $perKmSpeed;
// 1. حساب التسعيرة مع الذروة (للسائق)
$fareWithSurge = $baseFareForDistance + ($billableMinutes * $effectivePerMin);
$fareWithSurge = $startPrice + $baseFareForDistance + ($billableMinutes * $effectivePerMin);
$fareWithSurge *= $surgeMultiplier;
// 2. حساب التسعيرة الطبيعية بدون ذروة (لراكب Prime)
$fareNoSurge = $baseFareForDistance + ($billableMinutes * $naturePrice);
$fareNoSurge = $startPrice + $baseFareForDistance + ($billableMinutes * $naturePrice);
// نحدد التسعيرة الأساسية حسب حالة الراكب
$fare = $isPrime ? $fareNoSurge : $fareWithSurge;