'datetime', ]; /** 当前是否处于全平台禁约期(ban_until 为期满后可预约的最早时刻)。 */ public static function isGloballyBlocked(string $visitorPhone): bool { return static::query() ->where('visitor_phone', $visitorPhone) ->where('ban_until', '>', now()) ->exists(); } public static function activeBanUntil(string $visitorPhone): ?Carbon { $row = static::query() ->where('visitor_phone', $visitorPhone) ->where('ban_until', '>', now()) ->orderByDesc('ban_until') ->first(); return $row?->ban_until; } }