cahnged 20 enteries per page

This commit is contained in:
Harry Bomrah 2017-08-21 18:41:22 +08:00
parent 4b901a50e7
commit 0d0f76b3ff
1 changed files with 8 additions and 8 deletions

View File

@ -38,9 +38,9 @@ class MemberCounselorsController < CUserController
files = [] files = []
city = HpsCity.find(params[:city_id]) city = HpsCity.find(params[:city_id])
if !params[:type].present? || params[:type] == "proposals" if !params[:type].present? || params[:type] == "proposals"
hpsfiles = HpsFile.where(:hps_city_id => city.id, :hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) hpsfiles = HpsFile.where(:hps_city_id => city.id, :hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(20)
elsif params[:type] == "results" elsif params[:type] == "results"
hpsfiles = HpsResult.where(:hps_city_id => city.id, :hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) hpsfiles = HpsResult.where(:hps_city_id => city.id, :hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(20)
end end
hpsfiles.each do |file| hpsfiles.each do |file|
files << { files << {
@ -58,10 +58,10 @@ class MemberCounselorsController < CUserController
data["total_pages"] = hpsfiles.total_pages data["total_pages"] = hpsfiles.total_pages
else else
if !params[:type].present? || params[:type] == "proposals" if !params[:type].present? || params[:type] == "proposals"
hpsfiles = HpsFile.where(:hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) hpsfiles = HpsFile.where(:hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(20)
type = "proposals" type = "proposals"
elsif params[:type] == "results" elsif params[:type] == "results"
hpsfiles = HpsResult.where(:hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) hpsfiles = HpsResult.where(:hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(20)
type = "results" type = "results"
end end
data["files"] = hpsfiles.collect do |file| data["files"] = hpsfiles.collect do |file|
@ -99,10 +99,10 @@ class MemberCounselorsController < CUserController
} }
else else
if !params[:type].present? || params[:type] == "proposals" if !params[:type].present? || params[:type] == "proposals"
hpsfiles = HpsFile.where(:hps_member_id.in => schoolmembers).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) hpsfiles = HpsFile.where(:hps_member_id.in => schoolmembers).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(20)
type = "proposals" type = "proposals"
elsif params[:type] == "results" elsif params[:type] == "results"
hpsfiles = HpsResult.where(:hps_member_id.in => schoolmembers).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) hpsfiles = HpsResult.where(:hps_member_id.in => schoolmembers).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(20)
type = "results" type = "results"
end end
@ -145,10 +145,10 @@ class MemberCounselorsController < CUserController
} }
end end
if !params[:type].present? || params[:type] == "proposals" if !params[:type].present? || params[:type] == "proposals"
hpsfiles = HpsFile.where(:hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) hpsfiles = HpsFile.where(:hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(20)
type = "proposals" type = "proposals"
elsif params[:type] == "results" elsif params[:type] == "results"
hpsfiles = HpsResult.where(:hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) hpsfiles = HpsResult.where(:hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(20)
type = "results" type = "results"
end end
hpsfiles.each do |file| hpsfiles.each do |file|