From 800417eff48ad41e7fba2a04a942d391dd015aca Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 23 Jul 2019 10:49:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B7=AF=E5=BE=84=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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 54e9fe4b2..4e4d494ce 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -160,11 +160,14 @@ class SubjectsController < ApplicationController @shixuns = @shixuns.where(id: shixun_ids) end + @shixuns = @shixuns.reorder("created_at desc") @shixuns_count = @shixuns.count ## 分页参数 page = params[:page] || 1 - @shixuns = @shixuns.includes(:myshixuns).reorder("created_at desc").page(page).per(10) + @shixuns = @shixuns.page(page).per(10) + + @shixuns = @shixuns.includes(:myshixuns) end def append_to_stage