mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
add magnet form lock to prevent moderation overwrite
This commit is contained in:
parent
3ffe4a8651
commit
64e841ec4c
4 changed files with 39 additions and 1 deletions
|
|
@ -839,7 +839,6 @@ class Database {
|
|||
return $this->_db->lastInsertId();
|
||||
}
|
||||
|
||||
|
||||
public function deleteMagnetToExactSourceByMagnetId(int $magnetId) : int {
|
||||
|
||||
$this->_debug->query->delete->total++;
|
||||
|
|
@ -938,6 +937,29 @@ class Database {
|
|||
return $this->addMagnetToKeywordTopic($magnetId, $keywordTopicId);
|
||||
}
|
||||
|
||||
// Magnet lock
|
||||
public function addMagnetLock(int $magnetId, int $userId, int $timeAdded) : int {
|
||||
|
||||
$this->_debug->query->insert->total++;
|
||||
|
||||
$query = $this->_db->prepare('INSERT INTO `magnetLock` SET `magnetId` = ?, `userId` = ?, `timeAdded` = ?');
|
||||
|
||||
$query->execute([$magnetId, $userId, $timeAdded]);
|
||||
|
||||
return $this->_db->lastInsertId();
|
||||
}
|
||||
|
||||
public function findLastMagnetLock(int $magnetId) {
|
||||
|
||||
$this->_debug->query->select->total++;
|
||||
|
||||
$query = $this->_db->prepare('SELECT * FROM `magnetLock` WHERE `magnetId` = ? ORDER BY `magnetLockId` DESC LIMIT 1');
|
||||
|
||||
$query->execute([$magnetId]);
|
||||
|
||||
return $query->fetch();
|
||||
}
|
||||
|
||||
// Magnet comment
|
||||
public function getMagnetCommentsTotal(int $magnetId) : int {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue