whereStatus(1)->get(); if(!$nodeList->isEmpty()){ $msg = "|节点|上行流量|下行流量|合计|\r\n| :------ | :------ | :------ |\r\n"; foreach($nodeList as $node){ $log = SsNodeTrafficDaily::query() ->whereNodeId($node->id) ->where('created_at', '>=', date('Y-m-d 00:00:00', strtotime("-1 day"))) ->where('created_at', '<=', date('Y-m-d 23:59:59', strtotime("-1 day"))) ->first(); if($log){ $msg .= '|'.$node->name.'|'.flowAutoShow($log->u).'|'.flowAutoShow($log->d).'|'.$log->traffic."\r\n"; }else{ $msg .= '|'.$node->name.'|'.flowAutoShow(0).'|'.flowAutoShow(0)."|0B\r\n"; } } PushNotification::send('节点日报', $msg); } } $jobEndTime = microtime(TRUE); $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } }