This commit is contained in:
richboo111
2023-09-01 16:08:25 +08:00
parent f6e71c3c36
commit 6ee80aa437
3 changed files with 54 additions and 8 deletions

View File

@@ -500,13 +500,13 @@ func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, na
attrValue CommonAttrValue
attrValues []CommonAttrValue
)
//if nameID != 0 { //是否为纯创建
// if tData, err := dao.GetSkuNames(db, []int{nameID}, nil, "", false); err == nil && len(tData) > 0 {
// if tData[0].MtAttribute != "[]" && tData[0].MtAttribute != "{}" && tData[0].MtAttribute != "" {
// return tData[0].MtAttribute
// }
// }
//}
if nameID != 0 { //是否为纯创建
if tData, err := dao.GetSkuNames(db, []int{nameID}, nil, "", false); err == nil && len(tData) > 0 {
if tData[0].MtAttribute != "[]" && tData[0].MtAttribute != "{}" && tData[0].MtAttribute != "" {
return tData[0].MtAttribute
}
}
}
if vendorCatID == 0 { //创建商品时无分类,使用推荐分类
if comTag, err := apiObj.RetailRecommendTag(name, vendorStoreID, 0, mtwmapi.TypeCategory); err == nil && comTag.TagID != 0 {
tempCatID = int64(comTag.TagID)