DailyReportJob.php 635 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App\Jobs;
  3. use Illuminate\Contracts\Queue\ShouldQueue;
  4. use Illuminate\Foundation\Queue\Queueable;
  5. use Illuminate\Support\Facades\Log;
  6. use App\Services\FixtureService;
  7. // 每日执行任务
  8. class DailyReportJob implements ShouldQueue
  9. {
  10. use Queueable;
  11. /**
  12. * Create a new job instance.
  13. */
  14. public function __construct()
  15. {
  16. //
  17. }
  18. /**
  19. * Execute the job.
  20. */
  21. public function handle(): void
  22. {
  23. //
  24. Log::info('DailyReportJob executed at ' . now());
  25. FixtureService::index();
  26. Log::info('Generating daily report...');
  27. }
  28. }