From 9391c3aa3ba431a0d719656f67c40f625121739b Mon Sep 17 00:00:00 2001 From: anazaryan Date: Wed, 18 Dec 2024 21:58:53 +0400 Subject: [PATCH] check send telegramm --- app/Console/Commands/DispatchVacancyLiftJobCommand.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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; -- 1.7.10.4