From 49d2e83efa2a17037b19da9938644d5af8ddc754 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 7 Feb 2020 20:08:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/subjects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 77d89c40c..31bfdb91e 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -247,7 +247,7 @@ class SubjectsController < ApplicationController def send_to_course @course = Course.find_by!(id: params[:course_id]) - stages = @subject.stages.where(id: @subject.stage_shixuns.where(shixun_id: params[:shixun_ids]).pluck(:stage_id)) + stages = @subject.stages.where(id: @subject.stage_shixuns.where(shixun_id: params[:shixun_ids]).pluck(:stage_id)).reorder("stages.position DESC") order_ids = params[:shixun_ids].size > 0 ? params[:shixun_ids].reverse.join(',') : -1 course_module = @course.course_modules.where(module_type: "shixun_homework").first homework_ids = []