From e48932d74d683408e5115d4763f8d8ba289d1bc9 Mon Sep 17 00:00:00 2001 From: xiaomlove <1939737565@qq.com> Date: Tue, 21 Jan 2025 22:55:37 +0800 Subject: [PATCH] torrent extras createOrUpdate --- public/takeedit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/takeedit.php b/public/takeedit.php index 3dbdbe35..d8d27a33 100644 --- a/public/takeedit.php +++ b/public/takeedit.php @@ -242,7 +242,7 @@ $sql = "UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id"; do_log("[UPDATE_TORRENT]: $sql"); $affectedRows = sql_query($sql) or sqlerr(__FILE__, __LINE__); $torrentInfo = \App\Models\Torrent::query()->find($id); -$torrentInfo->extra()->update($extraUpdate); +$torrentInfo->extra()->updateOrCreate(['torrent_id' => $id], $extraUpdate); fire_event("torrent_updated", $torrentInfo, $torrentOld); $dateTimeStringNow = date("Y-m-d H:i:s");