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)
|
format := make(map[string][]*tiktokShop.ProductFormatNewList, 0)
|
||||||
for _, v := range category.Data.Data {
|
for _, v := range category.Data.Data {
|
||||||
if len(v.Options) == 0 {
|
if v.Required != 1 { // 必填属性必须填写
|
||||||
//formateNew := &tiktokShop.ProductFormatNewList{
|
continue
|
||||||
// Value: 0,
|
}
|
||||||
// Name: "暂不支持",
|
for _, d := range v.Options {
|
||||||
// DiyType: 1,
|
formateNew := &tiktokShop.ProductFormatNewList{
|
||||||
//}
|
Value: utils.Str2Int64(d.Value),
|
||||||
//format[utils.Int64ToStr(v.PropertyId)] = append(format[utils.Int64ToStr(v.CategoryId)], formateNew)
|
Name: d.Name,
|
||||||
} else {
|
DiyType: v.DiyType,
|
||||||
for _, d := range v.Options {
|
}
|
||||||
formateNew := &tiktokShop.ProductFormatNewList{
|
format[utils.Int64ToStr(v.PropertyId)] = append(format[utils.Int64ToStr(v.CategoryId)], formateNew)
|
||||||
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)
|
productFormatNew, err := json.Marshal(format)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user