diff --git a/apis/types.api b/apis/types.api index 27a5716..5be4d4c 100644 --- a/apis/types.api +++ b/apis/types.api @@ -708,6 +708,7 @@ type ( Price int64 `json:"price"` Amount int64 `json:"amount"` Discount int64 `json:"discount"` + PromoDiscount int64 `json:"promo_discount"` GiftAmount int64 `json:"gift_amount"` Coupon string `json:"coupon"` CouponDiscount int64 `json:"coupon_discount"` diff --git a/internal/logic/public/order/preCreateOrderLogic.go b/internal/logic/public/order/preCreateOrderLogic.go index fc07fb0..09415a8 100644 --- a/internal/logic/public/order/preCreateOrderLogic.go +++ b/internal/logic/public/order/preCreateOrderLogic.go @@ -123,6 +123,7 @@ func (l *PreCreateOrderLogic) PreCreateOrder(req *types.PurchaseOrderRequest) (r amount := int64(math.Round(float64(price) * discount)) discountAmount := price - amount + var promoDiscount int64 var couponAmount int64 if req.Coupon != "" { couponInfo, err := l.svcCtx.CouponModel.FindOneByCode(l.ctx, req.Coupon) @@ -185,6 +186,7 @@ func (l *PreCreateOrderLogic) PreCreateOrder(req *types.PurchaseOrderRequest) (r Price: price, Amount: amount, Discount: discountAmount, + PromoDiscount: promoDiscount, GiftAmount: deductionAmount, Coupon: req.Coupon, CouponDiscount: couponAmount, diff --git a/internal/types/types.go b/internal/types/types.go index 137a339..cc3e493 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -2012,6 +2012,7 @@ type PreOrderResponse struct { Price int64 `json:"price"` Amount int64 `json:"amount"` Discount int64 `json:"discount"` + PromoDiscount int64 `json:"promo_discount"` GiftAmount int64 `json:"gift_amount"` Coupon string `json:"coupon"` CouponDiscount int64 `json:"coupon_discount"`