aaa
This commit is contained in:
@@ -177,6 +177,8 @@ func UpdateUserRole(ctx *jxcontext.Context, userIDs []string, roleIDs []int) (er
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fmt.Println("1 ", addUserRoleMap)
|
||||||
|
fmt.Println("2 ", deleteUserRoleMap)
|
||||||
dao.Begin(db)
|
dao.Begin(db)
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
|
|||||||
@@ -518,6 +518,22 @@ func OnPayFinished(orderPay *model.OrderPay) (err error) {
|
|||||||
}
|
}
|
||||||
PickupGoods(order, false, "jxadmin")
|
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 {
|
} else {
|
||||||
switch orderPay.PayType {
|
switch orderPay.PayType {
|
||||||
|
|||||||
Reference in New Issue
Block a user