题库点击发送到后,先输入一个不存在的课程ID,点击确定,在出现请先选择课程的提示后删除输入的ID,此时会显示出该用户所有的课程,包括已经删除的
This commit is contained in:
parent
b20dc06e23
commit
07941233d8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue