fix can not remove all tags

This commit is contained in:
xiaomlove
2022-03-18 21:50:42 +08:00
parent 3ad8fabe7b
commit 805dc002f1
2 changed files with 4 additions and 3 deletions

View File

@@ -5311,6 +5311,9 @@ function insert_torrent_tags($torrentId, $tagIdArr, $sync = false)
if ($sync) {
sql_query("delete from torrent_tags where torrent_id = $torrentId");
}
if (empty($tagIdArr)) {
return;
}
$insertTagsSql = 'insert into torrent_tags (`torrent_id`, `tag_id`, `created_at`, `updated_at`) values ';
$values = [];
foreach ($tagIdArr as $tagId) {