Update: 2026-07-06 02:07:30
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user