| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- namespace app\api\command;
- use think\console\Command;
- use think\console\Input;
- use think\console\Output;
- use app\common\logic\TeamRewards;
- use app\common\model\TimedTaskLogModel;
- use think\Model;
- class Team extends Command
- {
- protected function configure()
- {
- $this->setName('Team')->setDescription('Here is the remark ');
- }
- 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()));
- // $output->writeln("SMH拨币:" . date('Y-m-d H:i:s', time()));
- // $begin = microtime(TRUE);
- // $log_id = (new \app\common\logic\Team())->AllocateSmh();
- // $time_total = round(microtime(true) - $begin, 4);//计算耗时
- // //更新发放日志
- // if($log_id > 0){
- // (new TimedTaskLogModel())
- // ->where('id', $log_id)
- // ->update([
- // 'id' => $log_id,
- // 'status' => 1,
- // 'end_time' => date('Y-m-d H:i:s'),
- // 'elapsed_time' => $time_total
- // ]);
- // }
- // $output->writeln('SMH拨币结束:' . date('Y-m-d H:i:s', time()) . '; 耗时:' . $time_total . '秒');
- // $output->writeln("Qubic拨币:" . date('Y-m-d H:i:s', time()));
- // $begin = microtime(TRUE);
- // $log_id = (new \app\common\logic\Team())->AllocateQubic();
- // $time_total = round(microtime(true) - $begin, 4);//计算耗时
- // //更新发放日志
- // if($log_id > 0){
- // (new TimedTaskLogModel())
- // ->where('id', $log_id)
- // ->update([
- // 'id' => $log_id,
- // 'status' => 1,
- // 'end_time' => date('Y-m-d H:i:s'),
- // 'elapsed_time' => $time_total
- // ]);
- // }
- // $output->writeln('Qubic拨币结束:' . date('Y-m-d H:i:s', time()) . '; 耗时:' . $time_total . '秒');
- $output->writeln("Aleo拨币:" . date('Y-m-d H:i:s', time()));
- $begin = microtime(TRUE);
- $log_id = (new \app\common\logic\Team())->AllocateAleo();
- $time_total = round(microtime(true) - $begin, 4);//计算耗时
- //更新发放日志
- if($log_id > 0){
- (new TimedTaskLogModel())
- ->where('id', $log_id)
- ->update([
- 'id' => $log_id,
- 'status' => 1,
- 'end_time' => date('Y-m-d H:i:s'),
- 'elapsed_time' => $time_total
- ]);
- }
- $output->writeln('Aleo拨币结束:' . date('Y-m-d H:i:s', time()) . '; 耗时:' . $time_total . '秒');
- $time_total = round(microtime(true) - $GLOBALS['_beginTime'], 4);//计算耗时
- $output->writeln('定时任务执行结束,总耗时' . date('Y-m-d H:i:s', time()) . '; 耗时:' . $time_total . '秒');
- }
- }
|