Update: 2026-07-23 20:15:22
This commit is contained in:
@@ -37,6 +37,11 @@ function getAllowedSocketUrls(): array {
|
||||
}
|
||||
// القيم الافتراضية لو لم تكن موجودة في .env
|
||||
return [
|
||||
'http://nginx',
|
||||
'http://socket_driver',
|
||||
'http://socket_passenger',
|
||||
'http://127.0.0.1',
|
||||
'http://localhost',
|
||||
'http://location.intaleq.xyz:2021',
|
||||
'http://location.intaleq.xyz:3031',
|
||||
'https://location.intaleq.xyz',
|
||||
@@ -311,7 +316,7 @@ function notifyDriversOnLocationServer($drivers_ids_array, $payload, $rideId = n
|
||||
* تخاطب السوكيت الموجود محلياً على نفس السيرفر
|
||||
*/
|
||||
function notifyPassengerOnRideServer($passenger_id, $payload) {
|
||||
$url = getenv('RIDE_SOCKET_URL') ?: 'http://nginx/loction_server/passenger_socket.php';
|
||||
$url = getenv('PASSENGER_SOCKET_INTERNAL_URL') ?: (getenv('RIDE_SOCKET_URL') ?: 'http://socket_passenger:3031');
|
||||
if (!isAllowedSocketUrl($url)) return null;
|
||||
$INTERNAL_KEY = function_exists('getInternalSocketKey') ? getInternalSocketKey() : '';
|
||||
|
||||
|
||||
@@ -21,10 +21,11 @@ try {
|
||||
FROM ride
|
||||
WHERE passenger_id = ?
|
||||
AND (
|
||||
status IN ('Apply', 'Applied', 'accepted', 'arrived', 'Arrived', 'Begin') AND created_at >= NOW() - INTERVAL 1 HOUR
|
||||
OR (status = 'Finished' AND created_at >= NOW() - INTERVAL 1 HOUR)
|
||||
status IN ('waiting', 'wait', 'Apply', 'Applied', 'accepted', 'arrived', 'Arrived', 'Begin')
|
||||
AND TIMESTAMP(date, time) >= NOW() - INTERVAL 1 HOUR
|
||||
OR (status = 'Finished' AND updated_at >= NOW() - INTERVAL 1 HOUR)
|
||||
)
|
||||
ORDER BY created_at DESC
|
||||
ORDER BY TIMESTAMP(date, time) DESC
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user