diff --git a/server/HoneyBox/src/HoneyBox.Admin.Business/Services/UserBusinessService.cs b/server/HoneyBox/src/HoneyBox.Admin.Business/Services/UserBusinessService.cs index ac1980f6..ed827492 100644 --- a/server/HoneyBox/src/HoneyBox.Admin.Business/Services/UserBusinessService.cs +++ b/server/HoneyBox/src/HoneyBox.Admin.Business/Services/UserBusinessService.cs @@ -350,8 +350,8 @@ public class UserBusinessService : IUserBusinessService throw new BusinessException(BusinessErrorCodes.NotFound, "用户不存在"); } - // 获取优惠券模板 - var coupon = await _dbContext.Coupons.FirstOrDefaultAsync(c => c.Id == request.CouponId && c.Status == 1); + // 获取优惠券模板 (status=0 表示有效/上架) + var coupon = await _dbContext.Coupons.FirstOrDefaultAsync(c => c.Id == request.CouponId && c.Status == 0); if (coupon == null) { throw new BusinessException(BusinessErrorCodes.NotFound, "优惠券不存在或已禁用");