diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 04c70e0f..9992d000 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -1796,7 +1796,7 @@ end @school_id = params[:school_id] if params[:school_id] && params[:school_id] != '' - @courses = Course.joins("join users u on courses.tea_id = u.id").joins("join user_extensions ue on u.id = ue.user_id").where("ue.school_id = #{params[:school_id]}") + @courses = @courses.joins("join user_extensions ue on courses.tea_id = ue.user_id").where("ue.school_id = #{params[:school_id]}") end if params[:homepage_show] @@ -1819,7 +1819,7 @@ end user_id = User.where("concat(lastname, firstname) like '%#{@search}%'") @courses = @courses.joins("join users u on courses.tea_id = u.id").where("concat(u.lastname, u.firstname) like '%#{@search}%'") end - else + elsif "dep_name" == @keyword school = School.where("name like '%#{@search}%'").map(&:id) @courses = @courses.where(:school_id => school) # @courses= @courses.where("name like '%#{@search}%'")