OrderPay.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\api\command;
  3. use app\common\logic\ScanLogic;
  4. use app\common\model\OfflineRechargeVerifyModel;
  5. use think\console\Command;
  6. use think\console\Input;
  7. use think\console\Output;
  8. use think\Model;
  9. /**
  10. * 充值订单的Hash校验类
  11. */
  12. class OrderPay extends Command
  13. {
  14. protected function configure()
  15. {
  16. $this->setName('OrderPay')->setDescription("订单支付校验");
  17. }
  18. protected function execute(Input $input, Output $output)
  19. {
  20. // 记录开始运行的时间
  21. $GLOBALS['_beginTime'] = microtime(TRUE);
  22. $output->writeln('定时任务开始执行:' . date('Y-m-d H:i:s', time()));
  23. $output->writeln('开始验证订单:' . date('Y-m-d H:i:s', time()));
  24. $rs = (new \app\common\logic\OrderPay())->scanOrderPay();
  25. $output->writeln('验证订单结束:' . date('Y-m-d H:i:s', time()));
  26. $output->writeln('开始取消订单:' . date('Y-m-d H:i:s', time()));
  27. (new \app\common\logic\OrderPay())->cancelOrder();
  28. $output->writeln('取消订单判断结束:' . date('Y-m-d H:i:s', time()));
  29. /*** 这里写计划任务列表集 END ***/
  30. $time_total = round(microtime(true) - $GLOBALS['_beginTime'], 4);//计算耗时
  31. $output->writeln('定时任务执行结束:' . date('Y-m-d H:i:s', time()) . '; 耗时:' . $time_total . '秒');
  32. }
  33. }