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
|
function getCount(): int
|
||||||
{
|
{
|
||||||
return sizeof(clone $this->clubs);
|
return (clone $this->clubs)->count('*');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPopularClubs(): \Traversable
|
function getPopularClubs(): \Traversable
|
||||||
|
|
|
@ -252,6 +252,6 @@ class Posts
|
||||||
|
|
||||||
function getCount(): int
|
function getCount(): int
|
||||||
{
|
{
|
||||||
return sizeof(clone $this->posts);
|
return (clone $this->posts)->count('*');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,9 +142,9 @@ class Users
|
||||||
function getStatistics(): object
|
function getStatistics(): object
|
||||||
{
|
{
|
||||||
return (object) [
|
return (object) [
|
||||||
"all" => sizeof(clone $this->users),
|
"all" => (clone $this->users)->count('*'),
|
||||||
"active" => sizeof((clone $this->users)->where("online > 0")),
|
"active" => (clone $this->users)->where("online > 0")->count('*'),
|
||||||
"online" => sizeof((clone $this->users)->where("online >= ?", time() - 900)),
|
"online" => (clone $this->users)->where("online >= ?", time() - 900)->count('*'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue