题库发送课程的弹框搜索不能用

This commit is contained in:
cxt 2016-03-10 15:48:39 +08:00
parent 55d14ecc65
commit fa3fd56686
1 changed files with 1 additions and 1 deletions

View File

@ -423,7 +423,7 @@ class UsersController < ApplicationController
end
def choose_user_course
homework = HomeworkCommon.find params[:homework].to_i
homework = HomeworkCommon.find params[:send_id].to_i
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)}