This commit is contained in:
yan.y 2024-07-11 11:59:56 +08:00
parent 65ec2c5dde
commit e2fb325452
1 changed files with 4 additions and 2 deletions

View File

@ -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)