|
|
|
@ -1083,7 +1083,12 @@ end
|
|
|
|
|
def enroll_list
|
|
|
|
|
@order = params[:order].blank? ? "desc" : params[:order]
|
|
|
|
|
@competition = Competition.where(:id => params[:competition]).first
|
|
|
|
|
@team_members = @competition.team_members.includes(:user => [:user_extensions => [:school]])
|
|
|
|
|
|
|
|
|
|
@only_teacher = @competition.competition_staffs.count == 1 && @competition.competition_staffs.first.category == 'teacher'
|
|
|
|
|
|
|
|
|
|
@team_members = @competition.team_members
|
|
|
|
|
@team_members = @team_members.where(is_teacher: false) unless @only_teacher # 只有老师报名时才显示老师,此时老师作为队员
|
|
|
|
|
|
|
|
|
|
if params[:school] || params[:location]
|
|
|
|
|
school_ids = School.where("schools.name like '%#{params[:school]}%'").pluck(:id)
|
|
|
|
|
school_ids = school_ids.size == 0 ? "(-1)" : "(" + school_ids.join(",") + ")"
|
|
|
|
@ -1093,7 +1098,7 @@ end
|
|
|
|
|
@page = params[:page] || 1
|
|
|
|
|
@team_members = @team_members.reorder("team_members.created_at #{@order}")
|
|
|
|
|
all_members = @team_members
|
|
|
|
|
@team_members = paginateHelper @team_members, 50
|
|
|
|
|
@team_members = paginateHelper(@team_members.includes(competition_team: [:user, teachers: :user], user: { user_extensions: :school }), 50)
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.js
|
|
|
|
|
format.html
|
|
|
|
|