7
This commit is contained in:
parent
277f663260
commit
920c3175f2
@ -175,8 +175,8 @@ func (b *UserCoupon) PutUserCouponUnnotified(c *gin.Context) {
|
||||
userCouponDao := dao.UserCouponDao{}
|
||||
maps := make(map[string]interface{})
|
||||
maps["user_id"] = userId
|
||||
userCoupon, _ := userCouponDao.GetUserCoupon(maps)
|
||||
if userCoupon == nil {
|
||||
userCoupons, _ := userCouponDao.GetUserCouponList(maps)
|
||||
if len(userCoupons) <= 0 {
|
||||
responses.OkWithData(nil, c)
|
||||
return
|
||||
}
|
||||
@ -189,9 +189,11 @@ func (b *UserCoupon) PutUserCouponUnnotified(c *gin.Context) {
|
||||
}
|
||||
}()
|
||||
|
||||
for _, coupon := range userCoupons {
|
||||
maps = make(map[string]interface{})
|
||||
maps["is_windows"] = 1
|
||||
_ = userCouponDao.EditUserCouponById(tx, userCoupon.UserCouponId, maps)
|
||||
_ = userCouponDao.EditUserCouponById(tx, coupon.UserCouponId, maps)
|
||||
}
|
||||
|
||||
tx.Commit()
|
||||
|
||||
|
||||
@ -247,7 +247,7 @@ func privateRouter(r *gin.Engine, api controller.Api) {
|
||||
couponGroup.GET("/unnotified", api.UserCoupon.GetUserCouponUnnotified)
|
||||
|
||||
// 修改还未弹窗的优惠卷
|
||||
couponGroup.PUT("/unnotified/:user_coupon_id", api.UserCoupon.PutUserCouponUnnotified)
|
||||
couponGroup.PUT("/unnotified", api.UserCoupon.PutUserCouponUnnotified)
|
||||
|
||||
usableGroup := couponGroup.Group("/usable")
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user