Merge pull request #35 from AlfredSK/AlfredSK-change-queries-from-open-to-not-closed
Show and count also servers with policy 'approve'
This commit is contained in:
commit
c18551c44c
|
@ -62,7 +62,7 @@ class Servers extends BaseController
|
||||||
|
|
||||||
$stmt = 'SELECT *
|
$stmt = 'SELECT *
|
||||||
FROM `server` s
|
FROM `server` s
|
||||||
WHERE `reg_policy` = "REGISTER_OPEN"
|
WHERE `reg_policy` != "REGISTER_CLOSED"
|
||||||
AND `available`
|
AND `available`
|
||||||
AND NOT `hidden`
|
AND NOT `hidden`
|
||||||
ORDER BY `health_score` DESC, `ssl_state` DESC, `info` != "" DESC, `last_seen` DESC
|
ORDER BY `health_score` DESC, `ssl_state` DESC, `info` != "" DESC, `last_seen` DESC
|
||||||
|
@ -81,7 +81,7 @@ LIMIT :start, :limit';
|
||||||
|
|
||||||
$stmt = 'SELECT COUNT(*)
|
$stmt = 'SELECT COUNT(*)
|
||||||
FROM `server` s
|
FROM `server` s
|
||||||
WHERE `reg_policy` = "REGISTER_OPEN"
|
WHERE `reg_policy` != "REGISTER_CLOSED"
|
||||||
AND `available`
|
AND `available`
|
||||||
AND NOT `hidden`';
|
AND NOT `hidden`';
|
||||||
$count = $this->atlas->fetchValue($stmt);
|
$count = $this->atlas->fetchValue($stmt);
|
||||||
|
|
|
@ -74,7 +74,7 @@ class Statistics extends BaseController
|
||||||
COUNT(*) AS `total`,
|
COUNT(*) AS `total`,
|
||||||
SUM(CASE WHEN `available` THEN 1 ELSE 0 END) AS `available`,
|
SUM(CASE WHEN `available` THEN 1 ELSE 0 END) AS `available`,
|
||||||
SUM(CASE WHEN `available` AND `language` IS NOT NULL THEN 1 ELSE 0 END) AS `language`,
|
SUM(CASE WHEN `available` AND `language` IS NOT NULL THEN 1 ELSE 0 END) AS `language`,
|
||||||
SUM(CASE WHEN `available` AND `reg_policy` = "REGISTER_OPEN" THEN 1 ELSE 0 END) AS `open`,
|
SUM(CASE WHEN `available` AND `reg_policy` != "REGISTER_CLOSED" THEN 1 ELSE 0 END) AS `open`,
|
||||||
SUM(CASE WHEN `available` AND `version` IS NOT NULL THEN 1 ELSE 0 END) AS `version`,
|
SUM(CASE WHEN `available` AND `version` IS NOT NULL THEN 1 ELSE 0 END) AS `version`,
|
||||||
SUM(CASE WHEN `available` AND (`version` = :dev_version OR `version` = :rc_version) THEN 1 ELSE 0 END) AS `dev_version`,
|
SUM(CASE WHEN `available` AND (`version` = :dev_version OR `version` = :rc_version) THEN 1 ELSE 0 END) AS `dev_version`,
|
||||||
SUM(CASE WHEN `available` AND `version` = :stable_version THEN 1 ELSE 0 END) AS `stable_version`,
|
SUM(CASE WHEN `available` AND `version` = :stable_version THEN 1 ELSE 0 END) AS `stable_version`,
|
||||||
|
|
Loading…
Reference in a new issue