BlackCompany.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Jobs\Cron;
  3. use App\Services\Jobfair\JobfairService;
  4. use Illuminate\Bus\Queueable;
  5. use Illuminate\Queue\SerializesModels;
  6. use Illuminate\Queue\InteractsWithQueue;
  7. use Illuminate\Contracts\Queue\ShouldQueue;
  8. use Illuminate\Foundation\Bus\Dispatchable;
  9. use Illuminate\Support\Facades\Log;
  10. class BlackCompany implements ShouldQueue
  11. {
  12. use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  13. const CREATE_LIST = 'create';
  14. const UPDATE_LIST = 'update';
  15. /**
  16. * Create a new job instance.
  17. *
  18. * @return void
  19. */
  20. public function __construct()
  21. {
  22. }
  23. /**
  24. * Execute the job.
  25. *
  26. * @return void
  27. */
  28. public function handle(JobfairService $jobfairService)
  29. {
  30. $res = $jobfairService->getJobfairCompany();
  31. if (!$res) {
  32. Log::error('jobfair_blacklists failed to delete.', [
  33. 'date' => [
  34. 'type'=>1,
  35. 'created_at'=>date('Y-m-d H:i:s', strtotime('-90 days')),
  36. ]
  37. ]);
  38. }
  39. }
  40. }