This commit is contained in:
邹宗楠
2023-09-25 18:36:23 +08:00
parent bf7364b7c1
commit dd9f657333
6 changed files with 31 additions and 6 deletions

View File

@@ -1033,12 +1033,14 @@ func (a *API) GetJdUpcCodeByName(name, upcCode string, pageNo, pageSize int) (pr
for _, vv := range ImgStr {
ImgList = append(ImgList, "http://img20.360buyimg.com/vc/"+vv.(string))
}
category, _ := utils.TryInterface2Int64(v.(map[string]interface{})["thirdCategoryId"])
productInfo := &ProductInfo{
OriginalName: v.(map[string]interface{})["name"].(string),
UpcCode: v.(map[string]interface{})["upcCode"].(string),
Weight: float32(utils.Interface2Float64WithDefault(v.(map[string]interface{})["weight"], 0) * 1000),
ImgList: ImgList,
BrandName: v.(map[string]interface{})["brandName"].(string),
Categories: []string{utils.Int64ToStr(category)},
}
productInfos = append(productInfos, productInfo)
}