dev_forum
cxt 5 years ago
parent ef5da1ea0e
commit 32ecb2ed6d

@ -110,9 +110,9 @@ class GraduationTasksController < ApplicationController
end end
# 排序 # 排序
rorder = params[:order].blank? ? "updated_at" : params[:order] rorder = params[:order].blank? ? "update_time" : params[:order]
b_order = params[:b_order].blank? ? "desc" : params[:b_order] b_order = params[:b_order].blank? ? "desc" : params[:b_order]
if rorder == "updated_at" || rorder == "work_score" if rorder == "update_time" || rorder == "work_score"
@work_list = @work_list.order("graduation_works.#{rorder} #{b_order}") @work_list = @work_list.order("graduation_works.#{rorder} #{b_order}")
elsif rorder == "student_id" elsif rorder == "student_id"
@work_list = @work_list.joins(user: :user_extension).order("user_extensions.#{rorder} #{b_order}") @work_list = @work_list.joins(user: :user_extension).order("user_extensions.#{rorder} #{b_order}")

Loading…
Cancel
Save