Update: 2026-07-14 00:34:22
This commit is contained in:
@@ -8,12 +8,8 @@ if ($transit_user_role !== 'driver') jsonError('Only drivers can access this end
|
||||
$tripId = filterRequest('trip_id', 'int');
|
||||
if (!$tripId) jsonError('trip_id is required', 400);
|
||||
|
||||
// استخرج سجل السائق من JWT
|
||||
$driverRow = $transit_con->prepare(
|
||||
"SELECT id FROM transit_drivers WHERE main_driver_id=? AND status='active' LIMIT 1"
|
||||
);
|
||||
$driverRow->execute([(string)$transit_user_id]);
|
||||
$driverRec = $driverRow->fetch();
|
||||
// استخرج سجل السائق من JWT (Redis read-through)
|
||||
$driverRec = transitResolveDriver((string)$transit_user_id);
|
||||
if (!$driverRec) jsonError('Driver not found or not active', 403);
|
||||
$driverId = (int)$driverRec['id'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user