选用实训的顺序

dev_tj
cxt 5 years ago
parent 63012e1ac7
commit c751f2a96b

@ -787,7 +787,8 @@ class HomeworkCommonsController < ApplicationController
def create_shixun_homework
tip_exception("请至少选择一个实训") if params[:shixun_ids].blank?
shixuns = Shixun.where(id: params[:shixun_ids]).order("field(id, #{params[:shixun_ids].reverse})")
order_ids = params[:shixun_ids].size > 0 ? params[:shixun_ids].reverse.join(',') : -1
shixuns = Shixun.where(id: params[:shixun_ids]).order("field(id, #{order_ids})")
@homework_ids = []
unless params[:category_id].blank?
@category = @course.course_second_categories.find_by(id: params[:category_id], category_type: "shixun_homework")

@ -200,7 +200,8 @@ class SubjectsController < ApplicationController
end
def append_to_stage
@shixuns = Shixun.where(id: params[:shixun_id]).order("field(id, #{params[:shixun_id]})")
order_ids = params[:shixun_id].size > 0 ? params[:shixun_id].join(',') : -1
@shixuns = Shixun.where(id: params[:shixun_id]).order("field(id, #{order_ids})")
end
# 添加实训项目

Loading…
Cancel
Save