Sfoglia il codice sorgente

节点流量监控

bingo 8 anni fa
parent
commit
fc96417022
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      app/Http/Controllers/AdminController.php

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

@@ -554,7 +554,7 @@ class AdminController extends BaseController
         }
         }
 
 
         // 节点24小时内每小时的流量
         // 节点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) {
         foreach ($nodeTrafficHourly as $hourly) {
             $hourlyData[] = round($hourly->total / (1024 * 1024), 2);
             $hourlyData[] = round($hourly->total / (1024 * 1024), 2);
         }
         }