Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

This commit is contained in:
huang 2016-03-10 16:44:05 +08:00
commit 5818860a4d
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)}