diff --git a/app/Console/Commands/DispatchVacancyLiftJobCommand.php b/app/Console/Commands/DispatchVacancyLiftJobCommand.php index 617f49d..7be90b4 100644 --- a/app/Console/Commands/DispatchVacancyLiftJobCommand.php +++ b/app/Console/Commands/DispatchVacancyLiftJobCommand.php @@ -16,7 +16,7 @@ class DispatchVacancyLiftJobCommand extends Command { $now = now()->timezone('Europe/Moscow')->format('H:i'); - $employers = EmployerAutoliftOption::query() + $employersAutoLift = EmployerAutoliftOption::query() ->where(function ($query) use ($now) { $query->where('times_per_day', 1) ->where('time_send_first', $now); @@ -37,15 +37,20 @@ class DispatchVacancyLiftJobCommand extends Command }); }) - ->orWhere('time_send_tg', $now) ->get(); + + LiftVacancyJob::dispatch( - $employers->whereNotNull('time_send_first')->pluck('employer_id')->toArray(), + $employersAutoLift->whereNotNull('time_send_first')->pluck('employer_id')->toArray(), ); + $employersSendTelegramm = EmployerAutoliftOption::query() + ->orWhere('time_send_tg', $now) + ->get(); + SendVacancyToTelegramJob::dispatch( - $employers->whereNotNull('time_send_tg')->pluck('employer_id')->toArray() + $employersSendTelegramm->whereNotNull('time_send_tg')->pluck('employer_id')->toArray() ); return Command::SUCCESS;