mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-03-13 05:41:02 +00:00
show available snaps only
This commit is contained in:
parent
2c5128382b
commit
ed240d53b0
@ -406,20 +406,20 @@ class MySQL {
|
||||
return $query->rowCount();
|
||||
}
|
||||
|
||||
public function getTotalHostPageSnaps(int $hostPageId) {
|
||||
public function getTotalHostPageSnaps(int $hostPageId, bool $storageLocal = true, bool $storageMega = true) {
|
||||
|
||||
$query = $this->_db->prepare('SELECT COUNT(*) AS `total` FROM `hostPageSnap` WHERE `hostPageId` = ?');
|
||||
$query = $this->_db->prepare('SELECT COUNT(*) AS `total` FROM `hostPageSnap` WHERE `hostPageId` = ? AND (`storageLocal` = ? OR `storageMega` = ?)');
|
||||
|
||||
$query->execute([$hostPageId]);
|
||||
$query->execute([$hostPageId, $storageLocal, $storageMega]);
|
||||
|
||||
return $query->fetch()->total;
|
||||
}
|
||||
|
||||
public function getHostPageSnaps(int $hostPageId) {
|
||||
public function getHostPageSnaps(int $hostPageId, bool $storageLocal = true, bool $storageMega = true) {
|
||||
|
||||
$query = $this->_db->prepare('SELECT * FROM `hostPageSnap` WHERE `hostPageId` = ? ORDER BY `timeAdded` DESC');
|
||||
$query = $this->_db->prepare('SELECT * FROM `hostPageSnap` WHERE `hostPageId` = ? AND (`storageLocal` = ? OR `storageMega` = ?) ORDER BY `timeAdded` DESC');
|
||||
|
||||
$query->execute([$hostPageId]);
|
||||
$query->execute([$hostPageId, $storageLocal, $storageMega]);
|
||||
|
||||
return $query->fetchAll();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user