fix: 产品分类颜色
This commit is contained in:
@@ -223,7 +223,7 @@ class Product extends Common
|
||||
foreach ($skus as $v) {
|
||||
// 找到相应产品的sku图片信息
|
||||
$skus_map[$v['product_id']][] = [
|
||||
'id' => $v['id'],
|
||||
'id' => $v['id'],
|
||||
'sku' => $v['sku'],
|
||||
'main_image' => $v['main_image'],
|
||||
];
|
||||
@@ -231,7 +231,7 @@ class Product extends Common
|
||||
$attr = $sku_attrs_map[$v['id']]?? [];
|
||||
if (!empty($attr)) {
|
||||
foreach ($attr as $at) {
|
||||
if ($at['attr_name'] == '颜色') {
|
||||
if (in_array($at['attr_name'], ['颜色', 'Color'])) {
|
||||
$color_map[$v['product_id']][] = $at;
|
||||
}
|
||||
}
|
||||
@@ -377,8 +377,8 @@ class Product extends Common
|
||||
|
||||
$v['attr_name'] = $attrs[$v['attr_id']]?? '';
|
||||
// 按属性分组
|
||||
$product_sku_attrs[$v['attr_id']]['attr_id'] = $v['attr_id'];
|
||||
$product_sku_attrs[$v['attr_id']]['attr_name'] = $v['attr_name'];
|
||||
$product_sku_attrs[$v['attr_id']]['attr_id'] = $v['attr_id'];
|
||||
$product_sku_attrs[$v['attr_id']]['attr_name'] = $v['attr_name'];
|
||||
$product_sku_attrs[$v['attr_id']]['attr_values'][] = [
|
||||
'sku_id' => $v['sku_id'],
|
||||
'attr_value' => $v['attr_value'],
|
||||
|
||||
Reference in New Issue
Block a user