From 43c9444f040193e20770e0e582ea51857d0cd397 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期二, 14 十一月 2023 19:03:35 +0800
Subject: [PATCH] 取消产品和用户表迁移(由aps控制)

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

diff --git a/model/purchase/purchase.go b/model/purchase/purchase.go
index c690479..01a5e2b 100644
--- a/model/purchase/purchase.go
+++ b/model/purchase/purchase.go
@@ -39,6 +39,10 @@
 	PaidAmount          decimal.Decimal     `json:"paidAmount" form:"paidAmount" gorm:"type:decimal(12,2);not null;default '';comment:宸蹭粯閲戦"`                //宸蹭粯閲戦
 }
 
+func (Purchase) TableName() string {
+	return "srm_purchase"
+}
+
 type OrderStatus int
 
 const (
@@ -94,7 +98,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