From bbff54b991d2d34e5506e726c2c0516fe20789e3 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期三, 30 七月 2025 18:58:57 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
index 79a977f..934697e 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
@@ -157,9 +157,11 @@
 			boolean tryLock = lock.tryLock(30, TimeUnit.SECONDS);
 			if (tryLock) {
 				//判断抽奖次数是否用完
-				int count = userLotteryEventService.count(new QueryWrapper<TUserLotteryEvent>().eq("lottery_event_id", id).eq("user_id", userId));
-				if (lotteryEvent.getTimes() <= count) {
-					return R.fail("抽奖次数已用完");
+				if(2 != lotteryEvent.getActivityType()){
+					int count = userLotteryEventService.count(new QueryWrapper<TUserLotteryEvent>().eq("lottery_event_id", id).eq("user_id", userId));
+					if (lotteryEvent.getTimes() <= count) {
+						return R.fail("抽奖次数已用完");
+					}
 				}
 				List<TLotteryEventPrize> lotteryEventPrizeList = lotteryEventPrizeService.list(new QueryWrapper<TLotteryEventPrize>().eq("lottery_event_id", id));
 				//开始抽奖,根据中奖概率来抽奖

--
Gitblit v1.7.1