Kernel.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Commands\MakeApacheConfCommand;
  4. use App\Console\Commands\MakeBlogUvCommand;
  5. use App\Console\Commands\MakeNginxConfCommand;
  6. use App\Form\Services\FormRecordService;
  7. use App\Web\Services\WebUtmService;
  8. use Illuminate\Console\Scheduling\Schedule;
  9. use Laravel\Lumen\Console\Kernel as ConsoleKernel;
  10. class Kernel extends ConsoleKernel
  11. {
  12. /**
  13. * The Artisan commands provided by your application.
  14. *
  15. * @var array
  16. */
  17. protected $commands = [
  18. MakeBlogUvCommand::class,
  19. MakeNginxConfCommand::class,
  20. MakeApacheConfCommand::class
  21. //
  22. ];
  23. /**
  24. * Define the application's command schedule.
  25. *
  26. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  27. * @return void
  28. */
  29. protected function schedule(Schedule $schedule)
  30. {
  31. //* * * * * cd /mp_website && php artisan schedule:run >> /dev/null 2>&1
  32. //发送邮件
  33. $schedule->call(function () {
  34. $service = app()->make(FormRecordService::class);
  35. $service->processRecordEmailSend();
  36. })->everyMinute()
  37. ->name('SendFormRecordEmail')
  38. ->withoutOverlapping(6000);
  39. //统计utm
  40. // */5 * * * * curl -k https://mp-website-test-munich.matchexpo.cn/cron/web-utm/persistence
  41. // $schedule->call(function () {
  42. // $service = app()->make(WebUtmService::class);
  43. // $service->persistenceUtmPvUv();
  44. // })->everyFiveMinutes()
  45. // ->name('persistenceUtmPvUv')
  46. // ->withoutOverlapping(6000);
  47. }
  48. }