Bladeren bron

feat:调整

fuwencai 4 maanden geleden
bovenliggende
commit
51fa605700
1 gewijzigde bestanden met toevoegingen van 10 en 9 verwijderingen
  1. 10 9
      src/jfw/modules/publicapply/src/activityday/dao/raffle.go

+ 10 - 9
src/jfw/modules/publicapply/src/activityday/dao/raffle.go

@@ -391,16 +391,17 @@ func (r *RaffleInfo) UserAccountInfo() (ua *Lua, err error) {
 			)
 			//今日是否已中奖
 			if now.Format(date.Date_Short_Layout) == strings.Split(createTime, " ")[0] {
-				if tmp, ok := (*ua)[pk]; ok {
-					todayNum = tmp.TodayNum
-				}
-				todayNum += 1
+				todayNum = 1
 			}
-			(*ua)[pk] = &entity.LotteryUserAccount{
-				ActiveId:   activeId,
-				PrizeId:    prizeInfoId,
-				CreateTime: createTime,
-				TodayNum:   todayNum,
+			if _, ok := (*ua)[pk]; ok {
+				(*ua)[pk].TodayNum += todayNum
+			} else {
+				(*ua)[pk] = &entity.LotteryUserAccount{
+					ActiveId:   activeId,
+					PrizeId:    prizeInfoId,
+					CreateTime: createTime,
+					TodayNum:   todayNum,
+				}
 			}
 			//此类奖品--中奖时间
 			r.PrizeTimesMap[pm] = append(r.PrizeTimesMap[pm], createTime)