创建标品优化
This commit is contained in:
@@ -1944,6 +1944,7 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader) (hint stri
|
|||||||
if len(skuNames2) == 1 && (productInfo.SpecQuality == skuNames2[0].SpecQuality && productInfo.SpecUnit == skuNames2[0].SpecUnit) {
|
if len(skuNames2) == 1 && (productInfo.SpecQuality == skuNames2[0].SpecQuality && productInfo.SpecUnit == skuNames2[0].SpecUnit) {
|
||||||
skuNames2[0].Upc = v.Upc
|
skuNames2[0].Upc = v.Upc
|
||||||
dao.UpdateEntity(db, skuNames2[0], "Upc")
|
dao.UpdateEntity(db, skuNames2[0], "Upc")
|
||||||
|
return "", err
|
||||||
} else {
|
} else {
|
||||||
if v.Price == 0 {
|
if v.Price == 0 {
|
||||||
result, err := api.AliUpcAPI.GetAliUpcInfo(*v.Upc)
|
result, err := api.AliUpcAPI.GetAliUpcInfo(*v.Upc)
|
||||||
@@ -1982,8 +1983,8 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader) (hint stri
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if !strings.Contains(skuName.Img, "image.jxc4.com") {
|
if !strings.Contains(skuName.Img, "image.jxc4.com") {
|
||||||
if resBinary, _, err := jxutils.DownloadFileByURL(skuName.Img); err == nil {
|
if resBinary, _, err := jxutils.DownloadFileByURL(skuName.Img + model.SkuNameImgStandard); err == nil {
|
||||||
if downloadURL, err := jxutils.UploadExportContent(resBinary, skuName.Img[strings.LastIndex(skuName.Img, "/"):len(skuName.Img)]); err == nil {
|
if downloadURL, err := jxutils.UploadExportContent(resBinary, skuName.Img[strings.LastIndex(skuName.Img, "/")+1:len(skuName.Img)]); err == nil {
|
||||||
skuName.Img = downloadURL
|
skuName.Img = downloadURL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user