Skip to content

Commit

Permalink
Fix query for total users
Browse files Browse the repository at this point in the history
Fix query that counts total
number of users to be displayed
on the home page

Bug: T348210
  • Loading branch information
Parthiv-M authored Oct 10, 2023
1 parent 6a39fbc commit 32f4dec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"logged-in-as": "You are logged in as $1",
"logout": "Log out",

"stats-summary": "$1 {{PLURAL:$2|person|people}} have taken part in $3 {{PLURAL:$4|contest|contests}}.",
"stats-summary": "$1 {{PLURAL:$2|person|people}} {{PLURAL:$2|has|have}} taken part in $3 {{PLURAL:$4|contest|contests}}.",

"all-contests": "All contests",
"your-contests": "Your contests",
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function getIdFromUsername( string $username ): string {
}

public function count(): int {
$sql = 'SELECT COUNT(*) AS tot FROM users';
$sql = 'SELECT COUNT(DISTINCT user_id) AS tot FROM scores';
$stmt = $this->db->prepare( $sql );
$result = $stmt->executeQuery();
return (int)$result->fetchAssociative()['tot'];
Expand Down

0 comments on commit 32f4dec

Please sign in to comment.