From fec85e2096536b1c4e2a6f300da7416bdd6281c9 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 14 Oct 2023 12:26:56 +0200 Subject: [PATCH] fix: check controller sending email to all The previous fix made things worse, it got no position data and then send email to everyone connected on vatsim that we had email for >:D --- app/Console/Commands/CheckOnlineControllers.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/CheckOnlineControllers.php b/app/Console/Commands/CheckOnlineControllers.php index 965cd1443..d2ae25f96 100644 --- a/app/Console/Commands/CheckOnlineControllers.php +++ b/app/Console/Commands/CheckOnlineControllers.php @@ -44,7 +44,9 @@ public function handle() } // Fetch which first four characters from ICAOs should look for based on positions database - $areasRaw = DB::raw('SELECT DISTINCT LEFT(callsign, 4) as prefix FROM positions;'); + $areasRaw = DB::table('positions') + ->select(DB::raw('DISTINCT LEFT(callsign, 4) as prefix')) + ->get(); $areas = collect(); foreach ($areasRaw as $a) {