1
This commit is contained in:
@@ -132,24 +132,17 @@ func GetProductFormatNew(categoryLeftId int64, vendorOrgCode string) (string, er
|
||||
}
|
||||
format := make(map[string][]*tiktokShop.ProductFormatNewList, 0)
|
||||
for _, v := range category.Data.Data {
|
||||
if len(v.Options) == 0 {
|
||||
//formateNew := &tiktokShop.ProductFormatNewList{
|
||||
// Value: 0,
|
||||
// Name: "暂不支持",
|
||||
// DiyType: 1,
|
||||
//}
|
||||
//format[utils.Int64ToStr(v.PropertyId)] = append(format[utils.Int64ToStr(v.CategoryId)], formateNew)
|
||||
} else {
|
||||
for _, d := range v.Options {
|
||||
formateNew := &tiktokShop.ProductFormatNewList{
|
||||
Value: utils.Str2Int64(d.Value),
|
||||
Name: d.Name,
|
||||
DiyType: v.DiyType,
|
||||
}
|
||||
format[utils.Int64ToStr(v.PropertyId)] = append(format[utils.Int64ToStr(v.CategoryId)], formateNew)
|
||||
}
|
||||
if v.Required != 1 { // 必填属性必须填写
|
||||
continue
|
||||
}
|
||||
for _, d := range v.Options {
|
||||
formateNew := &tiktokShop.ProductFormatNewList{
|
||||
Value: utils.Str2Int64(d.Value),
|
||||
Name: d.Name,
|
||||
DiyType: v.DiyType,
|
||||
}
|
||||
format[utils.Int64ToStr(v.PropertyId)] = append(format[utils.Int64ToStr(v.CategoryId)], formateNew)
|
||||
}
|
||||
|
||||
}
|
||||
productFormatNew, err := json.Marshal(format)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user