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