新增了优惠金额返回
This commit is contained in:
parent
7a367d329e
commit
b6032b8547
@ -60,6 +60,7 @@ type OrderProductDto struct {
|
|||||||
OrderInquiryCase *OrderInquiryCaseDto `json:"order_inquiry_case"` // 问诊病例
|
OrderInquiryCase *OrderInquiryCaseDto `json:"order_inquiry_case"` // 问诊病例
|
||||||
OrderProductCoupon *OrderProductCouponDto `json:"order_product_coupon"` // 优惠卷
|
OrderProductCoupon *OrderProductCouponDto `json:"order_product_coupon"` // 优惠卷
|
||||||
ProductName string `json:"product_name"` // 药品数据
|
ProductName string `json:"product_name"` // 药品数据
|
||||||
|
DiscountAmount float64 `json:"discount_amount"` // 优惠金额
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderProductConsigneeDto 药品订单收货人数据
|
// OrderProductConsigneeDto 药品订单收货人数据
|
||||||
|
|||||||
@ -86,6 +86,9 @@ func (r *OrderProductService) GetOrderProduct(orderProductId int64) (g *dto.Orde
|
|||||||
// 加载药品订单优惠卷数据
|
// 加载药品订单优惠卷数据
|
||||||
g.LoadOrderProductCoupon(orderProductCoupon)
|
g.LoadOrderProductCoupon(orderProductCoupon)
|
||||||
|
|
||||||
|
// 计算优惠金额
|
||||||
|
g.DiscountAmount = orderProduct.AmountTotal + orderProduct.LogisticsFee - orderProduct.CouponAmountTotal - orderProduct.PaymentAmountTotal
|
||||||
|
|
||||||
return g, nil
|
return g, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user