fix cancel torrent hr bulk not work

This commit is contained in:
xiaomlove
2024-05-08 02:36:52 +08:00
parent e54840bd0f
commit 2103ac3b68
3 changed files with 3 additions and 2 deletions
@@ -285,7 +285,7 @@ class TorrentResource extends Resource
])
->icon('heroicon-o-sparkles')
->action(function (Collection $records, array $data) {
if (empty($data['hr'])) {
if (!isset($data['hr'])) {
return;
}
$idArr = $records->pluck('id')->toArray();
+1
View File
@@ -668,6 +668,7 @@ class TorrentRepository extends BaseRepository
'hr' => $hrStatus,
];
$idArr = Arr::wrap($id);
do_log(sprintf("set torrent: %s hr: %s", implode(",", $idArr), $hrStatus));
return Torrent::query()->whereIn('id', $idArr)->update($update);
}