mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
fix(repositories): make db queries use count
This should fix /about page
This commit is contained in:
parent
b2b6fe6966
commit
88d296a9c4
3 changed files with 5 additions and 5 deletions
|
@ -53,7 +53,7 @@ class Clubs
|
|||
|
||||
function getCount(): int
|
||||
{
|
||||
return sizeof(clone $this->clubs);
|
||||
return (clone $this->clubs)->count('*');
|
||||
}
|
||||
|
||||
function getPopularClubs(): \Traversable
|
||||
|
|
|
@ -252,6 +252,6 @@ class Posts
|
|||
|
||||
function getCount(): int
|
||||
{
|
||||
return sizeof(clone $this->posts);
|
||||
return (clone $this->posts)->count('*');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,9 +142,9 @@ class Users
|
|||
function getStatistics(): object
|
||||
{
|
||||
return (object) [
|
||||
"all" => sizeof(clone $this->users),
|
||||
"active" => sizeof((clone $this->users)->where("online > 0")),
|
||||
"online" => sizeof((clone $this->users)->where("online >= ?", time() - 900)),
|
||||
"all" => (clone $this->users)->count('*'),
|
||||
"active" => (clone $this->users)->where("online > 0")->count('*'),
|
||||
"online" => (clone $this->users)->where("online >= ?", time() - 900)->count('*'),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue