21
This commit is contained in:
parent
7180f570fe
commit
b302b2e796
|
|
@ -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, "优惠券不存在或已禁用");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user