From a663fafe639997485bc80d95dd7b298a8f31e7f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 10 Apr 2020 11:08:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AEexcel=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=A0=87=E5=93=81=E5=9B=BE=E7=89=87=E6=A0=BC=E5=BC=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 5 +++++ business/model/store.go | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 2dc787176..5a72f0a1e 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1957,6 +1957,11 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader) (hint stri } } } + 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))) + continue + } skuName.Status = model.SkuStatusNormal skuName.IsGlobal = model.YES skuName.CategoryID = model.NoCatCatgoryID diff --git a/business/model/store.go b/business/model/store.go index 0655c2ea9..22dce3232 100644 --- a/business/model/store.go +++ b/business/model/store.go @@ -499,14 +499,13 @@ type PriceReferSnapshot struct { func (*PriceReferSnapshot) TableUnique() [][]string { return [][]string{ - []string{"CityCode", "SkuID", "SnapshotAt"}, []string{"CityCode", "NameID", "SkuID", "SnapshotAt"}, } } func (*PriceReferSnapshot) TableIndex() [][]string { return [][]string{ - []string{"SnapshotAt"}, + []string{"SkuID"}, } }