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)) {