puzhibing
2024-03-12 f25005e032ca124b0f6627a7192a034f08e680c9
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java
@@ -831,4 +831,22 @@
    public Map<String, Object> userGameRecordList(@RequestBody UserGameRecordList userGameRecordList){
        return worldCupCompetitorService.userGameRecordList(userGameRecordList);
    }
    /**
     * 获取已报名人数
     * @param worldCupId
     * @return
     */
    @ResponseBody
    @PostMapping("/worldCup/getRegisteredNumber")
    public int getRegisteredNumber(@RequestBody Integer worldCupId){
        List<WorldCupPayment> list = worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("worldCupId", worldCupId)
                .eq("payStatus", 2).eq("state", 1));
        List<Long> collect = list.stream().map(WorldCupPayment::getId).collect(Collectors.toList());
        if(collect.size() == 0){
            return 0;
        }
        return worldCupPaymentParticipantService.getCount(worldCupId, collect);
    }
}