1、新机预售券金额优化,根据配置金额调整,为空则等于实际支付金额;
This commit is contained in:
parent
04090fba93
commit
f3611088d5
|
@ -986,6 +986,13 @@ func PushWXPayNotice(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
var couponValue uint32
|
||||
if couponInfo.Value != 0 { // 如果预售券金额为0,则发放时抵扣金额=支付金额;否则=预售券金额
|
||||
couponValue = couponInfo.Value
|
||||
} else {
|
||||
couponValue = uint32(notifyInfo.TotalFee)
|
||||
}
|
||||
|
||||
couponCode, err := utils.GenerateRandomNumber19()
|
||||
if err != nil {
|
||||
logger.Error("GenerateRandomNumber19err:", err)
|
||||
|
@ -996,7 +1003,7 @@ func PushWXPayNotice(c *gin.Context) {
|
|||
CouponType: couponInfo.CouponType,
|
||||
ActivityType: couponInfo.ActivityType,
|
||||
ActivityId: couponInfo.ActivityId,
|
||||
Value: uint32(notifyInfo.TotalFee),
|
||||
Value: couponValue,
|
||||
State: 1,
|
||||
ActiveStart: time.Now(),
|
||||
ActiveEnd: time.Now().AddDate(0, 0, 180),
|
||||
|
@ -2499,6 +2506,13 @@ func HmPushWXPayNotice(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
var couponValue uint32
|
||||
if couponInfo.Value != 0 { // 如果预售券金额为0,则发放时抵扣金额=支付金额;否则=预售券金额
|
||||
couponValue = couponInfo.Value
|
||||
} else {
|
||||
couponValue = uint32(fundRecord.Amount)
|
||||
}
|
||||
|
||||
couponCode, err := utils.GenerateRandomNumber19()
|
||||
if err != nil {
|
||||
logger.Error("GenerateRandomNumber19err:", err)
|
||||
|
@ -2509,7 +2523,7 @@ func HmPushWXPayNotice(c *gin.Context) {
|
|||
CouponType: couponInfo.CouponType,
|
||||
ActivityType: couponInfo.ActivityType,
|
||||
ActivityId: couponInfo.ActivityId,
|
||||
Value: uint32(fundRecord.Amount),
|
||||
Value: couponValue,
|
||||
State: 1,
|
||||
ActiveStart: time.Now(),
|
||||
ActiveEnd: time.Now().AddDate(0, 0, 180),
|
||||
|
|
|
@ -34,6 +34,7 @@ type Coupon struct {
|
|||
MemberLevel uint32 `json:"member_level"` // 会员等级 1-用户 2-会员
|
||||
CategoryNumber string `json:"category_number"` // 可以使用该优惠券的商品分类,如果为空则表示没限制
|
||||
CommodityNumber string `json:"commodity_number"` // 可以使用该优惠券的商品编号,如果为空则表示没限制
|
||||
Limit uint32 `json:"limit"` // 优惠券叠加限制 0-不限制;1-仅限原价购买时使用
|
||||
IsDraw bool `json:"is_draw" gorm:"-"` //
|
||||
}
|
||||
|
||||
|
@ -59,7 +60,8 @@ type UserCoupon struct {
|
|||
CategoryNumber string `json:"category_number"` // 可以使用该优惠券的商品分类,如果为空则表示没限制
|
||||
CommodityNumber string `json:"commodity_number"` // 可以使用该优惠券的商品编号,如果为空则表示没限制
|
||||
Code string `json:"code"` // 优惠券券码
|
||||
StoreId uint32 `json:"store_id" gorm:"-"` // 邀请码对应门店id
|
||||
Limit uint32 `json:"limit"` // 优惠券叠加限制 0-不限制;1-仅限原价购买时使用
|
||||
StoreId uint32 `json:"store_id" gorm:"-"` // 邀请码对应门店id
|
||||
Availability uint32 `json:"availability" gorm:"-"` // 1-不可用 2-可用
|
||||
Coupon *Coupon `json:"coupon" gorm:"-"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user