mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
update totals block
This commit is contained in:
parent
6397e3d702
commit
1f22cb57e9
2 changed files with 120 additions and 23 deletions
|
|
@ -494,7 +494,7 @@ class Database {
|
|||
return $query->fetch();
|
||||
}
|
||||
|
||||
public function getUsersTotal() {
|
||||
public function getUsersTotal() : int {
|
||||
|
||||
$this->_debug->query->select->total++;
|
||||
|
||||
|
|
@ -505,6 +505,24 @@ class Database {
|
|||
return $query->fetch()->result;
|
||||
}
|
||||
|
||||
public function getUsersTotalByPublic(mixed $public) : int {
|
||||
|
||||
$this->_debug->query->select->total++;
|
||||
|
||||
if (is_null($public))
|
||||
{
|
||||
$query = $this->_db->prepare('SELECT COUNT(*) AS `result` FROM `user` WHERE `public` IS NULL');
|
||||
$query->execute();
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = $this->_db->prepare('SELECT COUNT(*) AS `result` FROM `user` WHERE `public` = ?');
|
||||
$query->execute([(int) $public]);
|
||||
}
|
||||
|
||||
return $query->fetch()->result;
|
||||
}
|
||||
|
||||
public function findUserByAddress(string $address) {
|
||||
|
||||
$this->_debug->query->select->total++;
|
||||
|
|
@ -632,6 +650,19 @@ class Database {
|
|||
return $query->fetch()->result;
|
||||
}
|
||||
|
||||
public function getMagnetsTotalByUsersPublic(bool $public) : int {
|
||||
|
||||
$this->_debug->query->select->total++;
|
||||
|
||||
$query = $this->_db->prepare('SELECT COUNT(*) AS `result` FROM `magnet`
|
||||
JOIN `user` ON (`user`.`userId` = `magnet`.`userId`)
|
||||
WHERE `user`.`public` = ?');
|
||||
|
||||
$query->execute([(int) $public]);
|
||||
|
||||
return $query->fetch()->result;
|
||||
}
|
||||
|
||||
public function updateMagnetDn(int $magnetId, string $dn, int $timeUpdated) : int {
|
||||
|
||||
$this->_debug->query->update->total++;
|
||||
|
|
@ -1246,6 +1277,19 @@ class Database {
|
|||
return $query->fetch()->result;
|
||||
}
|
||||
|
||||
public function getMagnetCommentsTotalByUsersPublic(bool $public) : int {
|
||||
|
||||
$this->_debug->query->select->total++;
|
||||
|
||||
$query = $this->_db->prepare('SELECT COUNT(*) AS `result` FROM `magnetComment`
|
||||
JOIN `user` ON (`user`.`userId` = `magnetComment`.`userId`)
|
||||
WHERE `user`.`public` = ?');
|
||||
|
||||
$query->execute([(int) $public]);
|
||||
|
||||
return $query->fetch()->result;
|
||||
}
|
||||
|
||||
public function getMagnetComments(int $magnetId, mixed $magnetCommentIdParent = null) {
|
||||
|
||||
$this->_debug->query->select->total++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue