diff --git a/api/service/coupon.go b/api/service/coupon.go index 192da62..14b49c5 100644 --- a/api/service/coupon.go +++ b/api/service/coupon.go @@ -509,13 +509,6 @@ func (r *CouponService) GrantSystemCoupon(couponId, adminUserId int64, req reque return false, errors.New("优惠卷非正常状态,不支持发放") } - // 检测订单过期时间 - now := time.Now() - validEndTime := time.Time(*coupon.ValidEndTime) - if now.After(validEndTime) { - return false, errors.New("优惠卷已过期,不支持发放") - } - // 检测优惠卷剩余数量 remainingQuantity := coupon.CouponCount - coupon.CouponTakeCount if remainingQuantity <= 0 { @@ -528,6 +521,7 @@ func (r *CouponService) GrantSystemCoupon(couponId, adminUserId int64, req reque } // 检测优惠卷过期时间 + now := time.Now() now = now.Add(time.Minute * 10) if coupon.ValidType == 1 { // 1:绝对时效