From 116d788ecc0c7a4eca4575d039a31db3aa1f260c Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Wed, 8 Jul 2026 18:01:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=E4=BF=A1=E6=81=AF=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/v1/Product.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/admin/controller/v1/Product.php b/app/admin/controller/v1/Product.php index 10d380a3..3d2ef6f2 100644 --- a/app/admin/controller/v1/Product.php +++ b/app/admin/controller/v1/Product.php @@ -270,14 +270,15 @@ class Product ProductCompatRelModel::productId($id)->delete(); $compat = []; - $rel_compat = json_decode(data_get($put['compat'], 'compat_id') ?? [], true); + $put_compat = json_decode($put['compat'], true); + $rel_compat = explode(',', str_replace(',', ',', data_get($put_compat, 'compat_id'))); foreach ($rel_compat as $compat_id) { $compat[] = [ 'product_id' => $id, 'compat_id' => $compat_id, - 'series_name' => data_get($put['compat'], 'series_name'), - 'show_series_name' => data_get($put['compat'], 'show_series_name') ?? 0, - 'remark' => data_get($put['compat'], 'remark') + 'series_name' => data_get($put_compat, 'series_name'), + 'show_series_name' => data_get($put_compat, 'show_series_name') ?? 0, + 'remark' => data_get($put_compat, 'remark') ]; } if (!empty($compat)) {