From e2fb3254527b83bcab065bf13608ea311f3a58f5 Mon Sep 17 00:00:00 2001 From: "yan.y" Date: Thu, 11 Jul 2024 11:59:56 +0800 Subject: [PATCH] update --- business/api/order.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/business/api/order.go b/business/api/order.go index a08139b..1911f25 100644 --- a/business/api/order.go +++ b/business/api/order.go @@ -307,11 +307,13 @@ func GetOrderDetail(orderId string) OrderDetail { Discount: float64(orderSub.Discount), Goods: goods, } + if orderSub.OrderStatus == 1 { + x := float64(orderSub.PayAmount) / 10 + orderSubR1.PayAmount = strconv.FormatFloat(x, 'f', 1, 64) + } if orderSubR1.Discount < 100 { //orderSubR1.PayAmount = int32(math.Round(float64(orderSubR1.TotalAmount) * (orderSubR1.Discount / 100.0))) //x := float64(orderSubR1.TotalAmount) * (orderSubR1.Discount / 100.0) / 10 - x := float64(orderSub.PayAmount) / 10 - orderSubR1.PayAmount = strconv.FormatFloat(x, 'f', 1, 64) orderSubR1.DiscountAmount = orderSubR1.PayAmount } else { orderSubR1.DiscountAmount = strconv.Itoa(orderSubR1.TotalAmount)