Update: 2026-07-04 18:43:56
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user