From 0d0f76b3ffc7623c7d80b392e6d702c36d65b11e Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 21 Aug 2017 18:41:22 +0800 Subject: [PATCH] cahnged 20 enteries per page --- app/controllers/member_counselors_controller.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/member_counselors_controller.rb b/app/controllers/member_counselors_controller.rb index c76cee9..4a6213c 100644 --- a/app/controllers/member_counselors_controller.rb +++ b/app/controllers/member_counselors_controller.rb @@ -38,9 +38,9 @@ class MemberCounselorsController < CUserController files = [] city = HpsCity.find(params[:city_id]) 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" - 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 hpsfiles.each do |file| files << { @@ -58,10 +58,10 @@ class MemberCounselorsController < CUserController data["total_pages"] = hpsfiles.total_pages else 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" 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" end data["files"] = hpsfiles.collect do |file| @@ -99,10 +99,10 @@ class MemberCounselorsController < CUserController } else 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" 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" end @@ -145,10 +145,10 @@ class MemberCounselorsController < CUserController } end 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" 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" end hpsfiles.each do |file|