根据excel创建标品图片格式优化

This commit is contained in:
苏尹岚
2020-04-10 11:08:40 +08:00
parent 7680508cab
commit a663fafe63
2 changed files with 6 additions and 2 deletions

View File

@@ -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

View File

@@ -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"},
}
}