This commit is contained in:
苏尹岚
2021-03-18 14:09:43 +08:00
parent 0f21a0df0b
commit e1fced0a71
2 changed files with 10 additions and 3 deletions

View File

@@ -1657,6 +1657,9 @@ func GetJdUpcCodeByName(ctx *jxcontext.Context, name, upcCode string) (productIn
} else {
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)
}
if result, err := api.MtwmAPI.GetStandardProductListWithCond(upcCode); err == nil && result != nil {
productInfo := &jdapi.ProductInfo{
OriginalName: result.Name,
@@ -2344,6 +2347,9 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader, categoryID
}
skuName.Skus[0].Status = model.SkuStatusNormal
if skuName.Img == model.NOSkuNameImg {
if configs, err := dao.QueryConfigs(dao.GetDB(), "mtwmCookieStr", model.ConfigTypeCookie, ""); err == nil {
api.MtwmAPI.SetCookieWithStr(configs[0].Value)
}
result, _ := api.MtwmAPI.GetStandardProductListWithCond(*skuName.Upc)
if result != nil {
imgs := strings.Split(result.Pic, ",")
@@ -2376,6 +2382,9 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader, categoryID
skuName.Img4 = imgs[3]
skuName.Img5 = imgs[4]
}
} else {
retVal = []*CreateUpcSkuByExcelErr{buildCreateUpcSkuByExcelErr(v, "美团cookie过期了吧")}
return retVal, err
}
}
//需要把图片传到七牛云上, 很难受

View File

@@ -375,9 +375,7 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) {
}
if stores, err := dao.GetStoreList(db, storeIDs, cityCodes, nil, brandIDs, nil, ""); len(stores) > 0 && err == nil {
for _, v := range stores {
if _, ok := resultMap[v.ID]; !ok {
resultMap[v.ID] = v.ID
}
resultMap[v.ID] = v.ID
}
}
}