Added sockets for notifications
This commit is contained in:
@@ -21,20 +21,17 @@ class UpdateDepartedFlights extends Command
|
||||
{
|
||||
$now = now()->utc();
|
||||
|
||||
$now = now()->utc();
|
||||
|
||||
$userFlights = UserFlight::where('departure_date', '<=', $now->toDateTimeString())
|
||||
->where('departure_date', '>', $now->copy()->subMinute()->toDateTimeString())
|
||||
->where(function ($query) {
|
||||
$query->whereNull('departure_processed_at')
|
||||
->orWhereColumn('departure_processed_at', '<', 'departure_date');
|
||||
})
|
||||
->get();
|
||||
|
||||
$this->info("Found {$userFlights->count()} flights.");
|
||||
|
||||
foreach ($userFlights as $flight) {
|
||||
$flight->touch();
|
||||
$flight->update(['departure_processed_at' => $now]);
|
||||
}
|
||||
|
||||
$this->info("Touching flight {$flight->id}");
|
||||
$result = $flight->touch();
|
||||
$this->info("Touch result: " . var_export($result, true));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user