fix(competition): 修复赛事详情页面报名人数显示为0的问题
This commit is contained in:
@@ -42,6 +42,13 @@ public class MartialCompetitionController extends BladeController {
|
||||
@Operation(summary = "详情", description = "传入ID")
|
||||
public R<MartialCompetition> detail(@RequestParam Long id) {
|
||||
MartialCompetition detail = competitionService.getById(id);
|
||||
if (detail != null) {
|
||||
Long cnt = martialAthleteService.count(Wrappers.<MartialAthlete>query().lambda()
|
||||
.eq(MartialAthlete::getCompetitionId, detail.getId())
|
||||
.eq(MartialAthlete::getIsDeleted, 0)
|
||||
);
|
||||
detail.setTotalParticipants(cnt.intValue());
|
||||
}
|
||||
return R.data(detail);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user