| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace app\api\command;
- use app\common\logic\ScanLogic;
- use app\common\model\OfflineRechargeVerifyModel;
- use think\console\Command;
- use think\console\Input;
- use think\console\Output;
- use think\Model;
- /**
- * 充值订单的Hash校验类
- */
- class OrderPay extends Command
- {
- protected function configure()
- {
- $this->setName('OrderPay')->setDescription("订单支付校验");
- }
- protected function execute(Input $input, Output $output)
- {
- // 记录开始运行的时间
- $GLOBALS['_beginTime'] = microtime(TRUE);
- $output->writeln('定时任务开始执行:' . date('Y-m-d H:i:s', time()));
- $output->writeln('开始验证订单:' . date('Y-m-d H:i:s', time()));
- $rs = (new \app\common\logic\OrderPay())->scanOrderPay();
- $output->writeln('验证订单结束:' . date('Y-m-d H:i:s', time()));
- $output->writeln('开始取消订单:' . date('Y-m-d H:i:s', time()));
- (new \app\common\logic\OrderPay())->cancelOrder();
- $output->writeln('取消订单判断结束:' . date('Y-m-d H:i:s', time()));
- /*** 这里写计划任务列表集 END ***/
- $time_total = round(microtime(true) - $GLOBALS['_beginTime'], 4);//计算耗时
- $output->writeln('定时任务执行结束:' . date('Y-m-d H:i:s', time()) . '; 耗时:' . $time_total . '秒');
- }
- }
|