Fix delete

This commit is contained in:
Visman 2023-03-25 20:20:17 +07:00
parent 1ca9788122
commit 54ea710623
2 changed files with 5 additions and 3 deletions
app/Models

View file

@ -153,7 +153,7 @@ class Delete extends Action
$query = 'SELECT p.poster_id
FROM ::posts AS p
INNER JOIN ::topics AS t ON t.id=p.topic_id
WHERE t.forum_id IN (?ai:forums)
WHERE t.forum_id IN (?ai:forums) AND p.poster_id>0
GROUP BY p.poster_id';
$uidsUpdate = $this->c->DB->query($query, $vars)->fetchAll(PDO::FETCH_COLUMN);
@ -175,7 +175,7 @@ class Delete extends Action
];
$query = 'SELECT p.poster_id
FROM ::posts AS p
WHERE p.topic_id IN (?ai:topics)
WHERE p.topic_id IN (?ai:topics) AND p.poster_id>0
GROUP BY p.poster_id';
$uidsUpdate = $this->c->DB->query($query, $vars)->fetchAll(PDO::FETCH_COLUMN);

View file

@ -92,7 +92,9 @@ class Delete extends Action
if ($topics) {
foreach ($topics as $topic) {
$uidsUpdate[$topic->poster_id] = $topic->poster_id;
if ($topic->poster_id > 0) {
$uidsUpdate[$topic->poster_id] = $topic->poster_id;
}
}
}