This commit is contained in:
suyl
2021-07-21 10:43:46 +08:00
parent 677d73e180
commit 66ff82e0be

View File

@@ -1660,19 +1660,19 @@ func GetJdUpcCodeByName(ctx *jxcontext.Context, name, upcCode string) (productIn
productInfos = append(productInfos, v.(*jdapi.ProductInfo))
}
} else {
productInfo, err = apijd.GetJdUpcCodeByName("", upcCode, 1, 30)
if err != nil {
return nil, err
}
for _, v := range productInfo {
_, name, _, specUnit, unit, specQuality := jxutils.SplitSkuName(v.OriginalName)
v.Name = name
v.SpecQuality = specQuality
v.SpecUnit = specUnit
v.Unit = unit
}
//productInfos, err = GetJdUpcCodeByCode(ctx, upcCode)
if len(productInfo) == 0 {
//productInfo, err = apijd.GetJdUpcCodeByName("", upcCode, 1, 30)
//if err != nil {
// return nil, err
//}
//for _, v := range productInfo {
// _, name, _, specUnit, unit, specQuality := jxutils.SplitSkuName(v.OriginalName)
// v.Name = name
// v.SpecQuality = specQuality
// v.SpecUnit = specUnit
// v.Unit = unit
//}
productInfos, err = GetJdUpcCodeByCode(ctx, upcCode)
if len(productInfos) == 0 {
if configs, err := dao.QueryConfigs(dao.GetDB(), "mtwmCookieStr", model.ConfigTypeCookie, ""); err == nil {
api.MtwmAPI.SetCookieWithStr(configs[0].Value)
}