From f3e53479ee303cbc7816e8ceb1ac0cf604dcc763 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 3 Jan 2025 19:49:41 +0000 Subject: [PATCH] Fixed landing page members count. --- src/LandingRoutes.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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()) {