From 4db59ea0d328d2a56443fab6c2bd7366a1ab3fc1 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 26 Sep 2016 15:07:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=A2=98=E5=BA=93=20?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=A4=E6=AC=A1=E5=90=8E=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 87dc127a0..792ba4690 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -625,7 +625,7 @@ class UsersController < ApplicationController visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}") end - @type = params[:type] + @type = params[:type] ? params[:type] : '1' @limit = 10 @is_remote = true @hw_count = @homeworks.count @@ -808,7 +808,7 @@ class UsersController < ApplicationController #@homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}") end end - @type = params[:type] + @type = params[:type] ? params[:type] : '1' @property = params[:property] @is_import = params[:is_import] @limit = params[:is_import].to_i == 1 ? 15 : 10