|
|
|
@ -624,12 +624,12 @@ class ShixunsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
def add_collaborators
|
|
|
|
|
member_ids = "(" + @shixun.shixun_members.map(&:user_id).join(',') + ")"
|
|
|
|
|
user_name = "%#{params[:user_name].strip}%"
|
|
|
|
|
school_name = "%#{params[:school_name].strip}%"
|
|
|
|
|
user_name = "%#{params[:user_name].to_s.strip}%"
|
|
|
|
|
school_name = "%#{params[:school_name].to_s.strip}%"
|
|
|
|
|
if user_name.present? || school_name.present?
|
|
|
|
|
@users = User.joins(user_extension: :school).where("users.id not in #{member_ids} AND users.status = 1 AND
|
|
|
|
|
LOWER(users.lastname) LIKE '#{user_name}' AND LOWER(schools.name) LIKE
|
|
|
|
|
'#{school_name}'")
|
|
|
|
|
'#{school_name}'").limit(20)
|
|
|
|
|
else
|
|
|
|
|
@users = User.none
|
|
|
|
|
end
|
|
|
|
|