From 1ee9a0c869d01067ec01a84b6a5b0a96c6aaba8e Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Wed, 16 Nov 2022 17:37:42 +0800 Subject: [PATCH] fix custom field checkbox --- nexus/Field/Field.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nexus/Field/Field.php b/nexus/Field/Field.php index 9906c060..fa5db5f9 100644 --- a/nexus/Field/Field.php +++ b/nexus/Field/Field.php @@ -403,7 +403,7 @@ JS; } $result[$row['torrent_id']][$row['id']] = $row; if ($typeInfo['is_value_multiple']) { - $values[$row['torrent_id']][$row['id']][] = $row['custom_field_value']; + $values[$row['torrent_id']][$row['id']] = json_decode($row['custom_field_value'], true); } else { $values[$row['torrent_id']][$row['id']] = $row['custom_field_value']; } @@ -529,7 +529,7 @@ JS; $insert[] = [ 'torrent_id' => $torrentId, 'custom_field_id' => $field->id, - 'custom_field_value' => $data[$field->id], + 'custom_field_value' => is_array($data[$field->id]) ? json_encode($data[$field->id]) : $data[$field->id], 'created_at' => $now, 'updated_at' => $now, ];