Explorar o código

节点流量监控

bingo %!s(int64=8) %!d(string=hai) anos
pai
achega
fc96417022
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/Http/Controllers/AdminController.php

+ 1 - 1
app/Http/Controllers/AdminController.php

@@ -554,7 +554,7 @@ class AdminController extends BaseController
         }
 
         // 节点24小时内每小时的流量
-        $nodeTrafficHourly = SsNodeTrafficHourly::query()->with(['info'])->where('node_id', $node->id)->where('created_at', '>=', date('Y-m-d H:i:s', strtotime("-24 hours")))->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("-1 hour")))->get();
+        $nodeTrafficHourly = SsNodeTrafficHourly::query()->with(['info'])->where('node_id', $node->id)->orderBy('id', 'asc')->limit(24)->get();
         foreach ($nodeTrafficHourly as $hourly) {
             $hourlyData[] = round($hourly->total / (1024 * 1024), 2);
         }