whereStatus(1)->get() as $node) { $this->pingNode( $node->id, $node->is_ddns ? $node->server : $node->ip ); } $jobEndTime = microtime(true); $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info( '---【' . $this->description . '】完成---,耗时' . $jobUsedTime . '秒' ); } // 节点Ping测速 private function pingNode($nodeId, $ip): void { $result = NetworkDetection::ping($ip); if ($result) { $obj = new NodePing(); $obj->node_id = $nodeId; $obj->ct = (int)$result['telecom']['time'];//电信 $obj->cu = (int)$result['Unicom']['time'];// 联通 $obj->cm = (int)$result['move']['time'];// 移动 $obj->hk = (int)$result['HongKong']['time'];// 香港 $obj->save(); } else { Log::error("【" . $ip . "】Ping测速获取失败"); } } }