From 063af419f54ab4fca8e8f3ed4d6b32aa44af029b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 23 Jul 2019 10:43:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=AF=BE=E7=A8=8B=E6=90=9C?= =?UTF-8?q?=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/subjects_controller.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 064061058..54e9fe4b2 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -160,14 +160,11 @@ class SubjectsController < ApplicationController @shixuns = @shixuns.where(id: shixun_ids) end - @shixuns = @shixuns.reorder("created_at desc") - @shixuns_count = @shixuns.size + @shixuns_count = @shixuns.count ## 分页参数 page = params[:page] || 1 - @shixuns = @shixuns.page(page).per(10) - - @shixuns = @shixuns.includes(:myshixuns) + @shixuns = @shixuns.includes(:myshixuns).reorder("created_at desc").page(page).per(10) end def append_to_stage