GenerateStat.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: sogndb
  5. * Date: 2018/02/05
  6. * Time: 下午5:26
  7. */
  8. namespace App\Console\Commands\SendOrder;
  9. use App\Modules\SendOrder\Services\SendOrderStatService;
  10. use Log;
  11. use Illuminate\Console\Command;
  12. class GenerateStat extends Command
  13. {
  14. /**
  15. * 执行命令 php artisan send_order:generate_day_stat
  16. *
  17. * The name and signature of the console command.
  18. *
  19. * @var string
  20. */
  21. protected $signature = 'send_order:generate_stat';
  22. /**
  23. * The console command description.
  24. *
  25. * @var string
  26. */
  27. protected $description = '派单统计数据生成';
  28. /**
  29. * Execute the console command.
  30. *
  31. * @return mixed
  32. */
  33. public function handle()
  34. {
  35. ini_set('memory_limit', '1024M');
  36. print_r('memory_used:'.memory_get_usage()."\n");
  37. print_r("======派单统计数据生成 【任务执行开始】=====".date("y-m-d H:i:s"."\n"));
  38. Log::info("======派单统计数据生成 【任务执行开始】=====".date("y-m-d H:i:s"."\n"));
  39. //SendOrderStatService::generateStat();
  40. SendOrderStatService::generateStatsByChunk();
  41. Log::info("======派单统计数据生成 【任务执行结束】=====".date("y-m-d H:i:s"."\n"));
  42. print_r("======派单统计数据生成 【任务执行结束】=====".date("y-m-d H:i:s"."\n"));
  43. print_r('memory_used:'.memory_get_usage()."\n");
  44. }
  45. }