ResetSendOrderReportDataCommand.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Console\DyReport;
  3. use App\Cache\StatisticCache;
  4. use Illuminate\Console\Command;
  5. use Illuminate\Support\Facades\DB;
  6. class ResetSendOrderReportDataCommand extends Command
  7. {
  8. /**
  9. * The name and signature of the console command.
  10. *
  11. * @var string
  12. */
  13. protected $signature = 'DyReport:ResetSendOrderReportData';
  14. /**
  15. * The console command description.
  16. *
  17. * @var string
  18. */
  19. protected $description = '每日0点重置所有派单链接的回传记录数';
  20. /**
  21. * Create a new command instance.
  22. *
  23. * @return void
  24. */
  25. public function __construct()
  26. {
  27. parent::__construct();
  28. }
  29. /**
  30. * Execute the console command.
  31. *
  32. * @return mixed
  33. */
  34. public function handle()
  35. {
  36. dLog('command_logs')->info('~~~~~~~~~~~~~~~~~~~~~~~~~~开始重置所有派单链接的回传记录数~~~~~~~~~~~~~~~~~~~~~~~~~~');
  37. $executeStart = microtime(true);
  38. $result = DB::table('send_orders')->update([
  39. 'report_receive_num' => 0,
  40. 'report_post_num' => 0
  41. ]);
  42. dLog('command_logs')->info('执行结果: ', ['result'=>$result]);
  43. $executeEnd = microtime(true);
  44. dLog('command_logs')->info('脚本运行时间: ', ['execute_time'=>round(($executeEnd - $executeStart), 6).'s']);
  45. dLog('command_logs')->info('~~~~~~~~~~~~~~~~~~~~~~~~~~结束重置所有派单链接的回传记录数~~~~~~~~~~~~~~~~~~~~~~~~~~');
  46. }
  47. }