fix: 修复产品兼容性信息更新问题
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 2s
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 2s
This commit is contained in:
@@ -270,14 +270,15 @@ class Product
|
|||||||
ProductCompatRelModel::productId($id)->delete();
|
ProductCompatRelModel::productId($id)->delete();
|
||||||
|
|
||||||
$compat = [];
|
$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) {
|
foreach ($rel_compat as $compat_id) {
|
||||||
$compat[] = [
|
$compat[] = [
|
||||||
'product_id' => $id,
|
'product_id' => $id,
|
||||||
'compat_id' => $compat_id,
|
'compat_id' => $compat_id,
|
||||||
'series_name' => data_get($put['compat'], 'series_name'),
|
'series_name' => data_get($put_compat, 'series_name'),
|
||||||
'show_series_name' => data_get($put['compat'], 'show_series_name') ?? 0,
|
'show_series_name' => data_get($put_compat, 'show_series_name') ?? 0,
|
||||||
'remark' => data_get($put['compat'], 'remark')
|
'remark' => data_get($put_compat, 'remark')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (!empty($compat)) {
|
if (!empty($compat)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user