mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 09:35:28 +00:00
fix stars counter
This commit is contained in:
parent
38b855779b
commit
74e7035123
3 changed files with 7 additions and 5 deletions
|
|
@ -1382,13 +1382,15 @@ class Database {
|
|||
return $query->fetch()->result;
|
||||
}
|
||||
|
||||
public function findMagnetStarsTotalByMagnetId(int $magnetId) : int {
|
||||
public function findMagnetStarsTotalByMagnetId(int $magnetId, bool $value) : int {
|
||||
|
||||
$this->_debug->query->select->total++;
|
||||
|
||||
$query = $this->_db->prepare('SELECT COUNT(DISTINCT `userId`) AS `result` FROM `magnetStar` WHERE `magnetId` = ?');
|
||||
$total = 0;
|
||||
|
||||
$query->execute([$magnetId]);
|
||||
$query = $this->_db->prepare('SELECT COUNT(DISTINCT `userId`) AS `result` FROM `magnetStar` WHERE `magnetId` = ? AND `value` = ?');
|
||||
|
||||
$query->execute([$magnetId, (int) $value]);
|
||||
|
||||
return $query->fetch()->result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue