fix: 修复产品兼容性信息更新问题
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 2s

This commit is contained in:
2026-07-08 18:01:24 +08:00
parent 0c20bd0519
commit 116d788ecc

View File

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