Use "failed" field

This commit is contained in:
Michael 2020-07-19 11:42:23 +00:00
parent ebcf757244
commit 5bf813d0ec
9 changed files with 22 additions and 24 deletions

View file

@ -64,14 +64,14 @@ class Federation extends BaseAdmin
$gservers = DBA::p("SELECT COUNT(*) AS `total`, SUM(`registered-users`) AS `users`, `platform`,
ANY_VALUE(`network`) AS `network`, MAX(`version`) AS `version`
FROM `gserver` WHERE `last_contact` >= `last_failure` GROUP BY `platform`");
FROM `gserver` WHERE NOT `failed` GROUP BY `platform`");
while ($gserver = DBA::fetch($gservers)) {
$total += $gserver['total'];
$users += $gserver['users'];
$versionCounts = [];
$versions = DBA::p("SELECT COUNT(*) AS `total`, `version` FROM `gserver`
WHERE `last_contact` >= `last_failure` AND `platform` = ?
WHERE NOT `failed` AND `platform` = ?
GROUP BY `version` ORDER BY `version`", $gserver['platform']);
while ($version = DBA::fetch($versions)) {
$version['version'] = str_replace(["\n", "\r", "\t"], " ", $version['version']);