This commit is contained in:
richboo111
2023-08-31 14:46:33 +08:00
parent fd6b1cc1d6
commit 70b7d9c2f9

View File

@@ -495,9 +495,10 @@ type ValueList struct {
func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, nameID int, name string) (attrs string) {
var (
db *dao.DaoDB
tempCatID int64
attrValue CommonAttrValue
db *dao.DaoDB
tempCatID int64
attrValue CommonAttrValue
attrValues []CommonAttrValue
)
//if nameID != 0 { //是否为纯创建
// if tData, err := dao.GetSkuNames(db, []int{nameID}, nil, "", false); err == nil && len(tData) > 0 {
@@ -538,9 +539,9 @@ func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, na
}
}
}
globals.SugarLogger.Debugf("1 attrValue==================%s", utils.Format4Output(attrValue, false))
attrValues = append(attrValues, attrValue)
}
var attrValues []CommonAttrValue
attrValues = append(attrValues, attrValue)
temp, _ := json.Marshal(attrValues)
attrs = string(temp)
globals.SugarLogger.Debugf("SwitchAttr attrValues=%s", utils.Format4Output(attrValues, false))