|
|
@ -2023,7 +2023,7 @@ end
|
|
|
|
# @schools = School.where(:id =>user_exs.map(&:school_id))
|
|
|
|
# @schools = School.where(:id =>user_exs.map(&:school_id))
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
@search = params[:search] # 搜索字
|
|
|
|
@search = params[:search] # 搜索字
|
|
|
|
@keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索
|
|
|
|
@keyword = params[:keyword].blank? ? "c_name" : params[:keyword] # 根据姓名/课程名搜索
|
|
|
|
@status = params[:status]
|
|
|
|
@status = params[:status]
|
|
|
|
@school_id = params[:school_id]
|
|
|
|
@school_id = params[:school_id]
|
|
|
|
|
|
|
|
|
|
|
@ -2044,11 +2044,13 @@ end
|
|
|
|
if params[:status] && params[:status]!=''
|
|
|
|
if params[:status] && params[:status]!=''
|
|
|
|
@courses = @courses.where(:is_end => @status.to_i)
|
|
|
|
@courses = @courses.where(:is_end => @status.to_i)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if "u_name" == @keyword
|
|
|
|
if "c_name" == @keyword
|
|
|
|
|
|
|
|
@courses = @courses.where("name like ?", "%#{@search}%")
|
|
|
|
|
|
|
|
elsif "u_name" == @keyword
|
|
|
|
if @search.blank?
|
|
|
|
if @search.blank?
|
|
|
|
@courses = @courses
|
|
|
|
@courses = @courses
|
|
|
|
else
|
|
|
|
else
|
|
|
|
user_id = User.where("concat(lastname, firstname) like '%#{@search}%'")
|
|
|
|
# user_id = User.where("concat(lastname, firstname) like '%#{@search}%'")
|
|
|
|
@courses = @courses.joins("join users u on courses.tea_id = u.id").where("concat(u.lastname, u.firstname) like '%#{@search}%'")
|
|
|
|
@courses = @courses.joins("join users u on courses.tea_id = u.id").where("concat(u.lastname, u.firstname) like '%#{@search}%'")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
elsif "dep_name" == @keyword
|
|
|
|
elsif "dep_name" == @keyword
|
|
|
|