CompanyDayUserStatistic.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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\CompanyDayUser;
  11. use Modules\Common\Services\Statistic\OptimizerDayUser;
  12. class CompanyDayUserStatistic extends Command
  13. {
  14. /**
  15. * The name and signature of the console command.
  16. *
  17. * @var string
  18. */
  19. protected $signature = 'Statistic:CompanyDayUser {--date= : 统计日期}';
  20. /**
  21. * The console command description.
  22. *
  23. * @var string
  24. */
  25. protected $description = '投放公司当日新增用户日统计';
  26. /**
  27. * Execute the console command.
  28. */
  29. public function handle(): void
  30. {
  31. $date = $this->option('date') ?? date('Y-m-d', strtotime('yesterday'));
  32. $this->info('统计开始--统计日期:'.$date);
  33. CompanyDayUser::companyDayUserStatistic($date);
  34. $this->info('统计结束');
  35. }
  36. }