From 4e265b8ade24c9512b835ddb76a910b4775f6611 Mon Sep 17 00:00:00 2001 From: Matteo Gheza Date: Thu, 16 Mar 2023 00:40:53 +0100 Subject: [PATCH] Remove availability when not scheduled --- backend/app/Jobs/UpdateAvailabilityWithSchedulesJob.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/app/Jobs/UpdateAvailabilityWithSchedulesJob.php b/backend/app/Jobs/UpdateAvailabilityWithSchedulesJob.php index d8f2344..d6bb5b6 100644 --- a/backend/app/Jobs/UpdateAvailabilityWithSchedulesJob.php +++ b/backend/app/Jobs/UpdateAvailabilityWithSchedulesJob.php @@ -44,5 +44,12 @@ class UpdateAvailabilityWithSchedulesJob implements ShouldQueue ["availability_manual_mode", "=", 0] ]) ->update(['available' => 1]); + + User::whereNotIn("id", $scheduled_users) + ->where([ + ["banned", "=", 0], + ["availability_manual_mode", "=", 0] + ]) + ->update(['available' => 0]); } }