竞赛战队详情

dev_aliyun
cxt 5 years ago
parent 74fd3f316d
commit d028eabf49

@ -20,6 +20,9 @@ class CompetitionTeamsController < ApplicationController
return render_404 if @competition.identifier != 'gcc-course-2019'
@competition_completed = false
# 竞赛正在进行,分数动态计算
@team_user_ids = @team.team_members.pluck(:user_id)
# 竞赛结束并且分数已经统计
if @competition.end_time < Time.current && CompetitionCourseRecord.exists?(competition_id: @competition.id)
@competition_completed = true
@ -27,9 +30,6 @@ class CompetitionTeamsController < ApplicationController
return
end
# 竞赛正在进行,分数动态计算
@team_user_ids = @team.team_members.pluck(:user_id)
shixuns = Shixun.where(user_id: @team_user_ids, status: 2)
.where('shixuns.created_at > ? && shixuns.created_at <= ?', Time.parse('2018-06-01'), @competition.end_time)
shixuns = shixuns.joins('left join shixuns forked_shixuns on forked_shixuns.fork_from = shixuns.id and forked_shixuns.status = 2')

Loading…
Cancel
Save