|
|
@@ -1016,17 +1016,9 @@ class ProductRepository extends BaseRepository
|
|
1016
|
1016
|
}
|
|
1017
|
1017
|
|
|
1018
|
1018
|
$res['isRelation'] = $isRelation ?? false;
|
|
1019
|
|
- foreach ($res['attrValue'] as $k => $value) {
|
|
1020
|
|
- $detail = $value['detail'] ?? null;
|
|
1021
|
|
- if (is_array($detail) && count($detail) > 0) {
|
|
1022
|
|
- $sku = implode(',', $detail);
|
|
1023
|
|
- } else {
|
|
1024
|
|
- $detail = ['默认'];
|
|
1025
|
|
- $sku = '默认';
|
|
1026
|
|
- }
|
|
1027
|
|
- $res['attrValue'][$k]['detail'] = $detail;
|
|
|
1019
|
+ foreach ($res['attrValue'] as $k => $value) {//兜底单规格老商品,如果没有那就填充默认
|
|
1028
|
1020
|
if (empty($value['sku'])) {
|
|
1029
|
|
- $res['attrValue'][$k]['sku'] = $sku;
|
|
|
1021
|
+ $res['attrValue'][$k]['sku'] = '默认';
|
|
1030
|
1022
|
}
|
|
1031
|
1023
|
}
|
|
1032
|
1024
|
$res['sku'] = $this->detailAttrValue($res['attrValue'], $userInfo, $res['product_type']);
|