竞赛报名的搜索列表无指导老师数据

dev_aliyun
cxt 6 years ago
parent 4bcc72a5db
commit c54aa9db44

@ -1105,12 +1105,12 @@ end
school_ids = School.where("schools.name like '%#{params[:school]}%'").pluck(:id) school_ids = School.where("schools.name like '%#{params[:school]}%'").pluck(:id)
school_ids = school_ids.size == 0 ? "(-1)" : "(" + school_ids.join(",") + ")" school_ids = school_ids.size == 0 ? "(-1)" : "(" + school_ids.join(",") + ")"
location = params[:location] && params[:location] != "0" ? params[:location] : "" location = params[:location] && params[:location] != "0" ? params[:location] : ""
@team_members = @team_members.where("user_extensions.school_id in #{school_ids} and schools.province like '%#{location}%'") @team_members = @team_members.includes(user: { user_extensions: :school }).where("user_extensions.school_id in #{school_ids} and schools.province like '%#{location}%'")
end end
@page = params[:page] || 1 @page = params[:page] || 1
@team_members = @team_members.reorder("team_members.created_at #{@order}") @team_members = @team_members.reorder("team_members.created_at #{@order}")
all_members = @team_members all_members = @team_members
@team_members = paginateHelper(@team_members.includes(competition_team: [:user, teachers: :user], user: { user_extensions: :school }), 50) @team_members = paginateHelper(@team_members.preload(competition_team: [:user, teachers: :user], user: { user_extensions: :school }), 50)
respond_to do |format| respond_to do |format|
format.js format.js
format.html format.html

Loading…
Cancel
Save