mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-03-31 17:15:38 +00:00
add magnet timeUpdated support, add updateMagnetXl method
This commit is contained in:
parent
535378fa64
commit
5b9e5e9f25
1 changed files with 17 additions and 3 deletions
|
|
@ -595,7 +595,8 @@ class Database {
|
|||
bool $comments,
|
||||
bool $sensitive,
|
||||
bool $approved,
|
||||
int $timeAdded) : int {
|
||||
int $timeAdded,
|
||||
mixed $timeUpdated = null) : int {
|
||||
|
||||
$this->_debug->query->insert->total++;
|
||||
|
||||
|
|
@ -607,7 +608,8 @@ class Database {
|
|||
`comments` = ?,
|
||||
`sensitive` = ?,
|
||||
`approved` = ?,
|
||||
`timeAdded` = ?');
|
||||
`timeAdded` = ?,
|
||||
`timeUpdated` = ?');
|
||||
|
||||
$query->execute(
|
||||
[
|
||||
|
|
@ -619,7 +621,8 @@ class Database {
|
|||
$comments ? 1 : 0,
|
||||
$sensitive ? 1 : 0,
|
||||
$approved ? 1 : 0,
|
||||
$timeAdded
|
||||
$timeAdded,
|
||||
$timeUpdated
|
||||
]
|
||||
);
|
||||
|
||||
|
|
@ -705,6 +708,17 @@ class Database {
|
|||
return $query->fetch()->result;
|
||||
}
|
||||
|
||||
public function updateMagnetXl(int $magnetId, int $xl, int $timeUpdated) : int {
|
||||
|
||||
$this->_debug->query->update->total++;
|
||||
|
||||
$query = $this->_db->prepare('UPDATE `magnet` SET `xl` = ?, `timeUpdated` = ? WHERE `magnetId` = ?');
|
||||
|
||||
$query->execute([$xl, $timeUpdated, $magnetId]);
|
||||
|
||||
return $query->rowCount();
|
||||
}
|
||||
|
||||
public function updateMagnetDn(int $magnetId, string $dn, int $timeUpdated) : int {
|
||||
|
||||
$this->_debug->query->update->total++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue