根据Excel创建标品处理京东没有图片的问题
This commit is contained in:
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user