From 49b60f7c23ce6f621500b13b80d9f72ae6cd1223 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Fri, 5 Jun 2020 13:26:22 +0800 Subject: [PATCH] update online user stat --- app/Http/Controllers/Admin/ServerController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Admin/ServerController.php b/app/Http/Controllers/Admin/ServerController.php index d3bd4247..91680109 100755 --- a/app/Http/Controllers/Admin/ServerController.php +++ b/app/Http/Controllers/Admin/ServerController.php @@ -26,7 +26,7 @@ class ServerController extends Controller $server[$i]['tags'] = json_decode($server[$i]['tags']); } $server[$i]['group_id'] = json_decode($server[$i]['group_id']); - $serverStat = Cache::get(CacheKey::get('SERVER_STAT', $server[$i]['parent_id'] ? $server[$i]['parent_id'] : $server[$i]['id'])); + $serverStat = Cache::get(CacheKey::get('SERVER_ONLINE_USER', $server[$i]['parent_id'] ? $server[$i]['parent_id'] : $server[$i]['id'])); if ($serverStat) { $serverStat = json_decode($serverStat, true); $server[$i]['u'] = $serverStat['u']; @@ -34,9 +34,9 @@ class ServerController extends Controller $server[$i]['online'] = $serverStat['online']; } if ($server[$i]['parent_id']) { - $server[$i]['last_check_at'] = Cache::get('server_last_check_at_' . $server[$i]['parent_id']); + $server[$i]['last_check_at'] = Cache::get(CacheKey::get('SERVER_LAST_CHECK_AT', $server[$i]['parent_id'])); } else { - $server[$i]['last_check_at'] = Cache::get('server_last_check_at_' . $server[$i]['id']); + $server[$i]['last_check_at'] = Cache::get(CacheKey::get('SERVER_LAST_CHECK_AT', $server[$i]['id'])); } } return response([