This commit is contained in:
richboo111
2023-08-31 14:41:09 +08:00
parent 6ec674a89e
commit fd6b1cc1d6

View File

@@ -499,13 +499,13 @@ func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, na
tempCatID int64
attrValue 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)