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 . '秒'); } }