根据名字查询京东upc
This commit is contained in:
@@ -1315,15 +1315,11 @@ func GetJdUpcCodeByName(ctx *jxcontext.Context, name, upcCode string) (productIn
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return retVal, err
|
return retVal, err
|
||||||
}
|
}
|
||||||
if len(productInfo) > 0 {
|
for _, v := range productInfo {
|
||||||
for _, v := range productInfo {
|
_, name, _, specUnit, _, specQuality := jxutils.SplitSkuName(v.OriginalName)
|
||||||
productInfo2, _ := api.ShowAPI.GetProductInfoByBarCode(v.UpcCode)
|
v.Name = name
|
||||||
if productInfo2 != nil {
|
v.SpecQuality = specQuality
|
||||||
v.Name = productInfo2.Name
|
v.SpecUnit = specUnit
|
||||||
v.SpecQuality = productInfo2.SpecQuality
|
|
||||||
v.SpecUnit = productInfo2.SpecUnit
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
retVal = productInfo
|
retVal = productInfo
|
||||||
return retVal, err
|
return retVal, err
|
||||||
|
|||||||
Reference in New Issue
Block a user