Compare commits

...

3 Commits

Author SHA1 Message Date
sxy
44f40ee10f Merge branch 'sxy' into dev 2025-06-20 14:34:09 +08:00
sxy
97c4bda203 修改价格模式-1 2025-06-20 14:33:57 +08:00
sxy
14415f07f5 修改价格模式 2025-06-20 14:31:55 +08:00
2 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
return res, errors.New("语言不能为空")
}
var options model.PriceOptions
if in.OriginalPrice == "" {
if in.PriceMode == 1 && in.OriginalPrice == "" {
return res, errors.New("原价不能为空")
}
originalPrice, parseErr := strconv.ParseFloat(in.OriginalPrice, 32)

View File

@ -166,7 +166,7 @@ func (options PriceOptions) CalculatePrice(priceMode, target int32) (float32, er
}
if match {
switch priceMode {
switch priceMode { //1 单价模式
case 1:
return float32(target) * opt.Price, nil
case 2: