From 18b58aaf9bd99cadd0e7f80fe5d80586f2f4831a Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期五, 24 十一月 2023 18:32:43 +0800
Subject: [PATCH] 11.24

---
 cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java b/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java
index e8a2393..e47ac6b 100644
--- a/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java
+++ b/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java
@@ -229,7 +229,19 @@
         String[] split = paymentCompetitionVo.getIds().split(";");
         Competition competition = this.getById(paymentCompetitionVo.getId());
 
-        int competitionId = userCompetitionService.count(new QueryWrapper<UserCompetition>().eq("competitionId", paymentCompetitionVo.getId()));
+        List<PaymentCompetition> list = paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>().eq("competitionId", paymentCompetitionVo.getId()).ne("payStatus", 3));
+        List<Long> pays = new ArrayList<>();
+        for (PaymentCompetition paymentCompetition : list) {
+            pays.add(paymentCompetition.getId());
+        }
+
+        int competitionId = 0;
+        if (!pays.isEmpty()) {
+            competitionId =   userCompetitionService.count(new QueryWrapper<UserCompetition>().in("paymentCompetitionId", pays));
+        }
+
+
+//        int competitionId = userCompetitionService.count(new QueryWrapper<UserCompetition>().eq("competitionId", paymentCompetitionVo.getId()));
         if ((competitionId+split.length)>competition.getApplicantsNumber()){
             return ResultUtil.error("报名人数超过最大限制");
         }

--
Gitblit v1.7.1