| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?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 RechargeTxHashVerify extends Command
- {
- protected function configure()
- {
- $this->setName('RechargeTxHashVerify')->setDescription("充值订单的Hash校验");
- }
- protected function execute(Input $input, Output $output)
- {
- /* 永不超时 */
- // ini_set('max_execution_time', 0);
- // 记录开始运行的时间
- $GLOBALS['_beginTime'] = microtime(TRUE);
- $output->writeln('定时任务开始执行:' . date('Y-m-d H:i:s', time()));
- $rs = (new ScanLogic())->scanCollectionAddress();
- if(!empty($rs)){
- // 记录执行记录
- (new OfflineRechargeVerifyModel())->insert([
- 'order_id' => 0,
- 'user_id' => 0,
- 'result' => $rs == '',
- 'fail_reason' => $rs,
- 'create_time' => time(),
- ]);
- }
- /*** 这里写计划任务列表集 END ***/
- $time_total = round(microtime(true) - $GLOBALS['_beginTime'], 4);//计算耗时
- $output->writeln('定时任务执行结束:' . date('Y-m-d H:i:s', time()) . '; 耗时:' . $time_total . '秒');
- }
- }
|