修改增值服务保存逻辑
This commit is contained in:
parent
bff2938313
commit
952caaaf91
@ -150,12 +150,15 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
||||
return res, errors.New("语言不能为空")
|
||||
}
|
||||
var options model.PriceOptions
|
||||
if in.PriceMode == 1 && in.OriginalPrice == "" {
|
||||
return res, errors.New("原价不能为空")
|
||||
}
|
||||
originalPrice, parseErr := strconv.ParseFloat(in.OriginalPrice, 32)
|
||||
if parseErr != nil {
|
||||
return res, errors.New("原价格式转换失败")
|
||||
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("原价格式转换失败")
|
||||
}
|
||||
}
|
||||
index := 1
|
||||
for _, option := range in.Options {
|
||||
|
@ -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{}{}
|
||||
|
Loading…
Reference in New Issue
Block a user