diff --git a/api/controller/UserCoupon.go b/api/controller/UserCoupon.go index e021d92..8ab6984 100644 --- a/api/controller/UserCoupon.go +++ b/api/controller/UserCoupon.go @@ -83,6 +83,20 @@ func (b *UserCoupon) GetUserCouponUnnotified(c *gin.Context) { return } + // 开始事务 + tx := global.Db.Begin() + defer func() { + if r := recover(); r != nil { + tx.Rollback() + } + }() + + maps = make(map[string]interface{}) + maps["is_windows"] = 1 + _ = userCouponDao.EditUserCouponById(tx, userCoupon.UserCouponId, maps) + + tx.Commit() + // 处理返回值 g := dto.GetUserCouponDto(userCoupon)