From e9cab1b49887cf39cacf10d97117c6df1597b28a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 10 Aug 2019 17:59:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=85=B3=E5=8D=A1=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/stages_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/stages_controller.rb b/app/controllers/stages_controller.rb index acf0e4829..b0b072f83 100644 --- a/app/controllers/stages_controller.rb +++ b/app/controllers/stages_controller.rb @@ -18,7 +18,7 @@ class StagesController < ApplicationController @stage.position = @subject.stages.count + 1 @stage.save! unless params[:shixun_id].blank? - shixuns = Shixun.where(id: params[:shixun_id]) + shixuns = Shixun.where(id: params[:shixun_id]).order("field(id, #{params[:shixun_id].join(",")})") shixuns.each do |shixun| StageShixun.create!(stage_id: @stage.id, subject_id: @subject.id, shixun_id: shixun.id, position: @stage.stage_shixuns.count + 1) end