aa
This commit is contained in:
@@ -1657,6 +1657,9 @@ func GetJdUpcCodeByName(ctx *jxcontext.Context, name, upcCode string) (productIn
|
|||||||
} else {
|
} else {
|
||||||
productInfos, err = GetJdUpcCodeByCode(ctx, upcCode)
|
productInfos, err = GetJdUpcCodeByCode(ctx, upcCode)
|
||||||
if len(productInfos) == 0 {
|
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 {
|
if result, err := api.MtwmAPI.GetStandardProductListWithCond(upcCode); err == nil && result != nil {
|
||||||
productInfo := &jdapi.ProductInfo{
|
productInfo := &jdapi.ProductInfo{
|
||||||
OriginalName: result.Name,
|
OriginalName: result.Name,
|
||||||
@@ -2344,6 +2347,9 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader, categoryID
|
|||||||
}
|
}
|
||||||
skuName.Skus[0].Status = model.SkuStatusNormal
|
skuName.Skus[0].Status = model.SkuStatusNormal
|
||||||
if skuName.Img == model.NOSkuNameImg {
|
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)
|
result, _ := api.MtwmAPI.GetStandardProductListWithCond(*skuName.Upc)
|
||||||
if result != nil {
|
if result != nil {
|
||||||
imgs := strings.Split(result.Pic, ",")
|
imgs := strings.Split(result.Pic, ",")
|
||||||
@@ -2376,6 +2382,9 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader, categoryID
|
|||||||
skuName.Img4 = imgs[3]
|
skuName.Img4 = imgs[3]
|
||||||
skuName.Img5 = imgs[4]
|
skuName.Img5 = imgs[4]
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
retVal = []*CreateUpcSkuByExcelErr{buildCreateUpcSkuByExcelErr(v, "美团cookie过期了吧")}
|
||||||
|
return retVal, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//需要把图片传到七牛云上, 很难受
|
//需要把图片传到七牛云上, 很难受
|
||||||
|
|||||||
@@ -375,12 +375,10 @@ 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 {
|
if stores, err := dao.GetStoreList(db, storeIDs, cityCodes, nil, brandIDs, nil, ""); len(stores) > 0 && err == nil {
|
||||||
for _, v := range stores {
|
for _, v := range stores {
|
||||||
if _, ok := resultMap[v.ID]; !ok {
|
|
||||||
resultMap[v.ID] = v.ID
|
resultMap[v.ID] = v.ID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// for k, _ := range brandIDMap {
|
// for k, _ := range brandIDMap {
|
||||||
// brandIDs = append(brandIDs, k)
|
// brandIDs = append(brandIDs, k)
|
||||||
// }
|
// }
|
||||||
|
|||||||
Reference in New Issue
Block a user