support trojan parent status

This commit is contained in:
Tokumeikoi 2020-07-01 23:08:26 +08:00
parent dc42e82dc0
commit 565072e333

View File

@ -23,8 +23,12 @@ class TrojanController extends Controller
} }
$server[$i]['group_id'] = json_decode($server[$i]['group_id']); $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]['online'] = Cache::get(CacheKey::get('SERVER_TROJAN_ONLINE_USER', $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'])); $server[$i]['last_check_at'] = Cache::get(CacheKey::get('SERVER_TROJAN_LAST_CHECK_AT', $server[$i]['id']));
} }
}
return response([ return response([
'data' => $server 'data' => $server
]); ]);