diff --git a/src/LandingRoutes.php b/src/LandingRoutes.php index 37ea158..5c6f191 100644 --- a/src/LandingRoutes.php +++ b/src/LandingRoutes.php @@ -26,13 +26,11 @@ class LandingRoutes implements RouteHandler { $stats->types = 0; $stats->members = 0; - $result = $this->dbCtx->connection->query('SELECT COUNT(upload_id) FROM prm_uploads'); - if($result->next()) + $result = $this->dbCtx->connection->query('SELECT COUNT(*), COUNT(DISTINCT user_id) FROM prm_uploads'); + if($result->next()) { $stats->uploads = $result->getInteger(0); - - $result = $this->dbCtx->connection->query('SELECT COUNT(user_id) FROM prm_users WHERE user_restricted IS NULL'); - if($result->next()) - $stats->members = $result->getInteger(0); + $stats->members = $result->getInteger(1); + } $result = $this->dbCtx->connection->query('SELECT COUNT(*), SUM(file_size), COUNT(DISTINCT file_type) FROM prm_files'); if($result->next()) {