From 07941233d8f6793895341994599a371034b808bb Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 3 Jun 2016 17:03:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E5=BA=93=E7=82=B9=E5=87=BB=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=88=B0=E5=90=8E=EF=BC=8C=E5=85=88=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84=E8=AF=BE?= =?UTF-8?q?=E7=A8=8BID=EF=BC=8C=E7=82=B9=E5=87=BB=E7=A1=AE=E5=AE=9A?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8=E5=87=BA=E7=8E=B0=E8=AF=B7=E5=85=88=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E8=AF=BE=E7=A8=8B=E7=9A=84=E6=8F=90=E7=A4=BA=E5=90=8E?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=BE=93=E5=85=A5=E7=9A=84ID=EF=BC=8C?= =?UTF-8?q?=E6=AD=A4=E6=97=B6=E4=BC=9A=E6=98=BE=E7=A4=BA=E5=87=BA=E8=AF=A5?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=89=80=E6=9C=89=E7=9A=84=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=EF=BC=8C=E5=8C=85=E6=8B=AC=E5=B7=B2=E7=BB=8F=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4cb838b8c..009d5c4d6 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -575,7 +575,7 @@ class UsersController < ApplicationController end if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id} and #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)} + @course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id} and (#{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p)",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)} else @course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)} end