diff --git a/model/product/model.go b/model/product/model.go index 59468ed..d2480b5 100644 --- a/model/product/model.go +++ b/model/product/model.go @@ -106,6 +106,9 @@ func (p *Product) CalRate() { tmpPrice = discountPrice - 10 p.CNYPrice = tmpPrice*p.ExchangeRate + p.Freight } + } else if p.Discount < 90 { + calculationProcess = append(calculationProcess, fmt.Sprintf("【打折扣】%.2f * %d%% * %.2f + %.2f = %.2f", p.USPrice, p.Discount, p.ExchangeRate, p.Freight, p.USPrice*float64(p.Discount)/100*p.ExchangeRate+p.Freight)) + p.CNYPrice = p.USPrice*float64(p.Discount)/100*p.ExchangeRate + p.Freight } p.CalMark = strings.Join(calculationProcess, "\n") if p.DWPrice > 0 {