From 32479e4d3a8f4ffeff1dda8e7e22243a8fd54db9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 22 Jun 2019 15:22:57 +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/graduation_tasks_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index a1f1d01c4..2e72c57d3 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -109,8 +109,8 @@ class GraduationTasksController < ApplicationController end # 排序 - rorder = params[:order] || "updated_at" - b_order = params[:b_order] || "desc" + rorder = params[:order].blank? ? "updated_at" : params[:order] + b_order = params[:b_order].blank? ? "desc" : params[:b_order] if rorder == "created_at" || rorder == "work_score" @work_list = @work_list.order("graduation_works.#{rorder} #{b_order}") elsif rorder == "student_id"