diff --git a/app/Console/Commands/DeleteExpiredAutoliftOptions.php b/app/Console/Commands/DeleteExpiredAutoliftOptions.php index 095db12..ff946b9 100644 --- a/app/Console/Commands/DeleteExpiredAutoliftOptions.php +++ b/app/Console/Commands/DeleteExpiredAutoliftOptions.php @@ -16,14 +16,10 @@ class DeleteExpiredAutoliftOptions extends Command { EmployerAutoliftOption::query() ->whereRaw('`updated_at` < DATE_SUB(NOW(), INTERVAL `days_repeat` DAY)') - ->update([ - 'is_enabled' => false - ]); + ->delete(); WorkerAutoliftOption::query() ->whereRaw('`updated_at` < DATE_SUB(NOW(), INTERVAL `days_repeat` DAY)') - ->update([ - 'is_enabled' => false - ]); + ->delete(); return Command::SUCCESS; } } diff --git a/app/Console/Commands/DispatchResumeLiftJobCommand.php b/app/Console/Commands/DispatchResumeLiftJobCommand.php index 1df006d..51da367 100644 --- a/app/Console/Commands/DispatchResumeLiftJobCommand.php +++ b/app/Console/Commands/DispatchResumeLiftJobCommand.php @@ -3,9 +3,6 @@ namespace App\Console\Commands; use App\Jobs\LiftResumeJob; -use App\Jobs\LiftVacancyJob; -use App\Jobs\SendVacancyToTelegramJob; -use App\Models\EmployerAutoliftOption; use App\Models\WorkerAutoliftOption; use Illuminate\Console\Command; @@ -36,7 +33,6 @@ class DispatchResumeLiftJobCommand extends Command ->orWhere('time_send_second', $now) ->orWhere('time_send_third', $now); }); - }) ->get(); diff --git a/app/Jobs/LiftResumeJob.php b/app/Jobs/LiftResumeJob.php index f4cb8eb..4317d75 100644 --- a/app/Jobs/LiftResumeJob.php +++ b/app/Jobs/LiftResumeJob.php @@ -2,7 +2,6 @@ namespace App\Jobs; -use App\Models\Ad_employer; use App\Models\Worker; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; diff --git a/app/Jobs/LiftVacancyJob.php b/app/Jobs/LiftVacancyJob.php index a0c9b48..086b905 100644 --- a/app/Jobs/LiftVacancyJob.php +++ b/app/Jobs/LiftVacancyJob.php @@ -24,6 +24,9 @@ class LiftVacancyJob implements ShouldQueue { Ad_employer::query() ->whereIn('employer_id', $this->employerIds) + ->where('autolift_site', 1) + ->where('active_is', 1) + ->where('is_remove', 0) ->update([ 'updated_at' => now() ]); diff --git a/app/Jobs/SendVacancyToTelegramJob.php b/app/Jobs/SendVacancyToTelegramJob.php index d5e7a22..848f463 100644 --- a/app/Jobs/SendVacancyToTelegramJob.php +++ b/app/Jobs/SendVacancyToTelegramJob.php @@ -31,6 +31,9 @@ class SendVacancyToTelegramJob implements ShouldQueue { $vacancies = Ad_employer::query() ->whereIn('employer_id', $this->employerIds) + ->where('autosend_tg', 1) + ->where('active_is', 1) + ->where('is_remove', 0) ->get(); foreach ($vacancies as $vacancy) {