根据Excel创建标品处理京东没有图片的问题

This commit is contained in:
苏尹岚
2020-04-13 18:06:34 +08:00
parent 18d7f0f6d2
commit 6f64c953c8

View File

@@ -1967,9 +1967,15 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader) (hint stri
skuName.Skus[0].Weight = int(utils.Str2Int64(utils.Float64ToStr(float64(productInfo.Weight))))
if len(productInfo.ImgList) > 0 {
skuName.Img = productInfo.ImgList[0]
} else {
skuName.Img = model.NOSkuNameImg
}
}
}
if skuName.Img == "" {
createUpcSkuByExcelErrList = append(createUpcSkuByExcelErrList, buildCreateUpcSkuByExcelErr(v, "未查询到商品图片,请联系开发!"))
continue
}
suffix := skuName.Img[strings.LastIndex(skuName.Img, "."):]
if suffix != ".jpg" && suffix != ".png" && suffix != ".jpeg" && suffix != ".gif" {
createUpcSkuByExcelErrList = append(createUpcSkuByExcelErrList, buildCreateUpcSkuByExcelErr(v, fmt.Sprintf("暂不支持的图片格式:[%v]", skuName.Img)))