From dd07a07290bf66fde945dbbebc23ae048205775d Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期五, 22 九月 2023 10:19:46 +0800
Subject: [PATCH] 分页查询product列表搜索条件合并

---
 model/purchase/purchase.go |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/model/purchase/purchase.go b/model/purchase/purchase.go
index c690479..0e9fbdb 100644
--- a/model/purchase/purchase.go
+++ b/model/purchase/purchase.go
@@ -94,7 +94,7 @@
 func (slf Purchase) CalcRealTotalPrice() decimal.Decimal {
 	totalPrice := slf.TotalPrice
 	if slf.WholeDiscountType == WholeDiscountTypePercent {
-		totalPrice = totalPrice.Mul(slf.WholeDiscount).Div(decimal.NewFromInt(100))
+		totalPrice = totalPrice.Mul(decimal.NewFromInt(1).Sub(slf.WholeDiscount.Div(decimal.NewFromInt(100))))
 	} else if slf.WholeDiscountType == WholeDiscountTypeDiscount {
 		totalPrice = totalPrice.Sub(slf.WholeDiscount)
 	}

--
Gitblit v1.8.0