Compare commits

..

No commits in common. "9d57cb0188173992fb7bd1943c98d157ea274456" and "c5459886630f1496c6539cf65ca48ae8cecd724a" have entirely different histories.

2 changed files with 7 additions and 10 deletions

View File

@ -150,15 +150,12 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
return res, errors.New("语言不能为空")
}
var options model.PriceOptions
var originalPrice float64
if in.PriceMode == 1 {
if in.OriginalPrice == "" {
return res, errors.New("原价不能为空")
}
originalPrice, err = strconv.ParseFloat(in.OriginalPrice, 32)
if err != nil {
return res, errors.New("原价格式转换失败")
}
if in.PriceMode == 1 && in.OriginalPrice == "" {
return res, errors.New("原价不能为空")
}
originalPrice, parseErr := strconv.ParseFloat(in.OriginalPrice, 32)
if parseErr != nil {
return res, errors.New("原价格式转换失败")
}
index := 1
for _, option := range in.Options {

View File

@ -130,7 +130,7 @@ func ValidateOptions(options PriceOptions) (bool, error) {
}
for _, n := range nums {
if _, exist := cover[n]; exist {
return false, errors.New("条件存在冲突,请重新设置")
return false, errors.New("条件冲突")
}
cover[n] = struct{}{}