From 565072e33375a21c90addafb114df67ed341cec9 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Wed, 1 Jul 2020 23:08:26 +0800 Subject: [PATCH] support trojan parent status --- app/Http/Controllers/Admin/Server/TrojanController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Admin/Server/TrojanController.php b/app/Http/Controllers/Admin/Server/TrojanController.php index e6d5a1a4..d3dae5c5 100644 --- a/app/Http/Controllers/Admin/Server/TrojanController.php +++ b/app/Http/Controllers/Admin/Server/TrojanController.php @@ -23,7 +23,11 @@ class TrojanController extends Controller } $server[$i]['group_id'] = json_decode($server[$i]['group_id']); $server[$i]['online'] = Cache::get(CacheKey::get('SERVER_TROJAN_ONLINE_USER', $server[$i]['id'])); - $server[$i]['last_check_at'] = Cache::get(CacheKey::get('SERVER_TROJAN_LAST_CHECK_AT', $server[$i]['id'])); + if ($server[$i]['parent_id']) { + $server[$i]['last_check_at'] = Cache::get(CacheKey::get('SERVER_TROJAN_LAST_CHECK_AT', $server[$i]['parent_id'])); + } else { + $server[$i]['last_check_at'] = Cache::get(CacheKey::get('SERVER_TROJAN_LAST_CHECK_AT', $server[$i]['id'])); + } } return response([ 'data' => $server