From 53c6ee15ffdfe2821bebf9b9776a830b0c84101b Mon Sep 17 00:00:00 2001 From: timerzz Date: Tue, 28 May 2024 21:56:55 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E8=AE=A1=E7=AE=97=E6=89=93=E6=8A=98?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E6=8A=98=E6=89=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/product/model.go | 3 +++ 1 file changed, 3 insertions(+) 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 {