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