Update: 2026-07-12 18:53:59
This commit is contained in:
@@ -196,6 +196,29 @@ function transitClearTripOwner(int $tripId): void
|
||||
$redisLocation->del("transit:trip:{$tripId}:owner");
|
||||
}
|
||||
|
||||
// ── عضوية الراكب في Redis (location Redis — بدون بادئة siro:) ──────
|
||||
// يستخدمها passenger_socket.php للتحقق قبل قبول subscribe_transit_route.
|
||||
// تُكتب عند: تفعيل عضوية برقم الكشف، أو موافقة المشرف على الطلب اليدوي.
|
||||
// تُحذف عند: رفض أو تعليق العضوية.
|
||||
|
||||
function transitCacheEnrollment(int $orgId, string $passengerId): void
|
||||
{
|
||||
global $redisLocation;
|
||||
if (!$redisLocation || !$passengerId) return;
|
||||
|
||||
$key = "transit:org_members:{$orgId}";
|
||||
$redisLocation->sAdd($key, $passengerId);
|
||||
$redisLocation->expire($key, 7 * 86400); // تجديد TTL سبعة أيام
|
||||
}
|
||||
|
||||
function transitDropEnrollment(int $orgId, string $passengerId): void
|
||||
{
|
||||
global $redisLocation;
|
||||
if (!$redisLocation || !$passengerId) return;
|
||||
|
||||
$redisLocation->sRem("transit:org_members:{$orgId}", $passengerId);
|
||||
}
|
||||
|
||||
// ── days_mask helpers ────────────────────────────────────────
|
||||
// bit0=Sun … bit6=Sat | 62 = 0b0111110 = الأحد–الخميس
|
||||
|
||||
|
||||
Reference in New Issue
Block a user