SyncCpSubscribeStatisticDataFromZW.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Console\Commands\ContentManage;
  3. use Illuminate\Console\Command;
  4. use Modules\ContentManage\Services\CpManage\SyncSubscribe;
  5. class SyncCpSubscribeStatisticDataFromZW extends Command
  6. {
  7. /**
  8. * The name and signature of the console command.
  9. *
  10. * @var string
  11. */
  12. protected $signature = 'ContentManage:SyncCpSubscribeStatisticDataFromZW {--startDate= : 开始日期如2023-03-01}
  13. {--endDate= : 结束日期如2023-03-02}';
  14. /**
  15. * The console command description.
  16. *
  17. * @var string
  18. */
  19. protected $description = '从掌维拉取cp书籍订阅数据';
  20. /**
  21. * Execute the console command.
  22. */
  23. public function handle(): void
  24. {
  25. $startDate = $this->option('startDate');
  26. $endDate = $this->option('endDate');
  27. $syncService = new SyncSubscribe();
  28. $syncService->syncStartDate = $startDate;
  29. $syncService->syncEndDate = $endDate;
  30. $syncService->sync();
  31. }
  32. }