GenerateCpBookStat.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * zhoulj
  4. * 2018-05-15
  5. */
  6. namespace App\Console\Commands\CP;
  7. use App\Modules\CP\Services\GenerateCpBookStatService;
  8. use Illuminate\Console\Command;
  9. use Log;
  10. class GenerateCpBookStat extends Command
  11. {
  12. /**
  13. * 执行命令 php artisan cp_generate_cp_book_stat
  14. *
  15. * The name and signature of the console command.
  16. *
  17. * @var string
  18. */
  19. protected $signature = 'cp_generate_cp_book_stat';
  20. /**
  21. * The console command description.
  22. *
  23. * @var string
  24. */
  25. protected $description = '每日CP图书订阅数据生成';
  26. /**
  27. * Execute the console command.
  28. *
  29. * @return mixed
  30. */
  31. public function handle()
  32. {
  33. print_r("======每日CP图书订阅数据生成 【任务执行开始】=====" . date("y-m-d H:i:s" . "\n"));
  34. Log::info("======每日CP图书订阅数据生成【任务执行开始】=====" . date("y-m-d H:i:s" . "\n"));
  35. // 生成每日统计
  36. $date = date("Y-m-d", strtotime('-1 day'));
  37. GenerateCpBookStatService::generateCpBookDailyStat($date);
  38. //GenerateCpBookStatService::generateCpBookDailyStat2('2018-12-09');
  39. Log::info("======每日CP图书订阅数据生成 【任务执行结束】=====" . date("y-m-d H:i:s" . "\n"));
  40. print_r("======每日CP图书订阅数据生成 【任务执行结束】=====" . date("y-m-d H:i:s" . "\n"));
  41. }
  42. }