Commit 1c31cc44dac58bf30a9338d6004964d8f6732dda

Authored by Fedor K
Exists in master

Merge branch 'task-132985' into 'master'

task-132985 minor fixes

Showing 5 changed files Side-by-side Diff

app/Console/Commands/DeleteExpiredAutoliftOptions.php
... ... @@ -16,14 +16,10 @@ class DeleteExpiredAutoliftOptions extends Command
16 16 {
17 17 EmployerAutoliftOption::query()
18 18 ->whereRaw('`updated_at` < DATE_SUB(NOW(), INTERVAL `days_repeat` DAY)')
19   - ->update([
20   - 'is_enabled' => false
21   - ]);
  19 + ->delete();
22 20 WorkerAutoliftOption::query()
23 21 ->whereRaw('`updated_at` < DATE_SUB(NOW(), INTERVAL `days_repeat` DAY)')
24   - ->update([
25   - 'is_enabled' => false
26   - ]);
  22 + ->delete();
27 23 return Command::SUCCESS;
28 24 }
29 25 }
app/Console/Commands/DispatchResumeLiftJobCommand.php
... ... @@ -3,9 +3,6 @@
3 3 namespace App\Console\Commands;
4 4  
5 5 use App\Jobs\LiftResumeJob;
6   -use App\Jobs\LiftVacancyJob;
7   -use App\Jobs\SendVacancyToTelegramJob;
8   -use App\Models\EmployerAutoliftOption;
9 6 use App\Models\WorkerAutoliftOption;
10 7 use Illuminate\Console\Command;
11 8  
... ... @@ -36,7 +33,6 @@ class DispatchResumeLiftJobCommand extends Command
36 33 ->orWhere('time_send_second', $now)
37 34 ->orWhere('time_send_third', $now);
38 35 });
39   -
40 36 })
41 37 ->get();
42 38  
app/Jobs/LiftResumeJob.php
... ... @@ -2,7 +2,6 @@
2 2  
3 3 namespace App\Jobs;
4 4  
5   -use App\Models\Ad_employer;
6 5 use App\Models\Worker;
7 6 use Illuminate\Bus\Queueable;
8 7 use Illuminate\Contracts\Queue\ShouldQueue;
app/Jobs/LiftVacancyJob.php
... ... @@ -24,6 +24,9 @@ class LiftVacancyJob implements ShouldQueue
24 24 {
25 25 Ad_employer::query()
26 26 ->whereIn('employer_id', $this->employerIds)
  27 + ->where('autolift_site', 1)
  28 + ->where('active_is', 1)
  29 + ->where('is_remove', 0)
27 30 ->update([
28 31 'updated_at' => now()
29 32 ]);
app/Jobs/SendVacancyToTelegramJob.php
... ... @@ -31,6 +31,9 @@ class SendVacancyToTelegramJob implements ShouldQueue
31 31 {
32 32 $vacancies = Ad_employer::query()
33 33 ->whereIn('employer_id', $this->employerIds)
  34 + ->where('autosend_tg', 1)
  35 + ->where('active_is', 1)
  36 + ->where('is_remove', 0)
34 37 ->get();
35 38  
36 39 foreach ($vacancies as $vacancy) {