OptimizerDayUserStatistic.php 975 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * 优化师新增用户统计
  4. * @file:PromotionDayUserStatistic.php
  5. * @Date: 2023/6/25
  6. * @Time: 16:38
  7. */
  8. namespace App\Console\Commands\Statistic;
  9. use Illuminate\Console\Command;
  10. use Modules\Common\Services\Statistic\OptimizerDayUser;
  11. class OptimizerDayUserStatistic extends Command
  12. {
  13. /**
  14. * The name and signature of the console command.
  15. *
  16. * @var string
  17. */
  18. protected $signature = 'Statistic:OptimizerDayUser {--date= : 统计日期}';
  19. /**
  20. * The console command description.
  21. *
  22. * @var string
  23. */
  24. protected $description = '优化师当日新增用户日统计';
  25. /**
  26. * Execute the console command.
  27. */
  28. public function handle(): void
  29. {
  30. $date = $this->option('date') ?? date('Y-m-d', strtotime('yesterday'));
  31. $this->info('统计开始--统计日期:'.$date);
  32. OptimizerDayUser::optimizerDayUserStatistic($date);
  33. $this->info('统计结束');
  34. }
  35. }