aaa
This commit is contained in:
@@ -518,6 +518,22 @@ func OnPayFinished(orderPay *model.OrderPay) (err error) {
|
||||
}
|
||||
PickupGoods(order, false, "jxadmin")
|
||||
// }
|
||||
} else {
|
||||
//普通的订单要看用没用优惠券,用了的话,要把这个用户用过的优惠券状态改了
|
||||
if order.CouponIDs != "" {
|
||||
sCouponIDs := strings.Split(order.CouponIDs, ",")
|
||||
couponIDs := []int{}
|
||||
for _, v := range sCouponIDs {
|
||||
couponIDs = append(couponIDs, utils.Str2Int(v))
|
||||
}
|
||||
if userCoupons, err := dao.GetUserCoupons(db, couponIDs, []string{order.UserID}, nil, model.CouponStatusNormal); err == nil {
|
||||
for _, vv := range userCoupons {
|
||||
vv.UserCouponStatus = model.UserCouponStatusUsed
|
||||
vv.UpdatedAt = time.Now()
|
||||
dao.UpdateEntity(db, vv, "UserCouponStatus", "UpdatedAt")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch orderPay.PayType {
|
||||
|
||||
Reference in New Issue
Block a user