Update: 2026-07-04 18:43:56

This commit is contained in:
Hamza-Ayed
2026-07-04 18:43:57 +03:00
parent 3412f1b753
commit 3e0b4cbf64
65 changed files with 2260 additions and 118 deletions
+18 -7
View File
@@ -61,13 +61,24 @@ try {
continue;
}
$validDrivers[] = [
'id' => $d_id,
'distance' => $d_dist,
'heading' => $profile['heading'] ?? 0,
'speed' => $profile['speed'] ?? 0,
'lat' => $d_coord[1], // Latitude من الريدز (أدق)
'lng' => $d_coord[0] // Longitude من الريدز
// 🆕 فحص driver:public cache (بيانات السائق الثابتة)
$public = $redis->hgetall("driver:public:$d_id");
$hasCache = !empty($public) && !empty($public['first_name']);
$validDrivers[] = $hasCache ? array_merge($public, [
'id' => $d_id,
'driver_id' => $d_id,
'distance' => $d_dist,
'cached' => true
]) : [
'id' => $d_id,
'driver_id' => $d_id,
'distance' => $d_dist,
'heading' => $profile['heading'] ?? 0,
'speed' => $profile['speed'] ?? 0,
'latitude' => $d_coord[1],
'longitude' => $d_coord[0],
'cached' => false
];
if (count($validDrivers) >= $limit) break;