云上实验版本的调整

dev_home
cxt 5 years ago
parent 482c8d836d
commit 6e0bd9c1f9

@ -467,7 +467,8 @@ class CoursesController < ApplicationController
# user_ids_of_course_members = @course.course_members.where(role: [1,2,3]).pluck(:user_id)
# @users = User.where.not(id: user_ids_of_course_members)
@users = User.where(status: User::STATUS_ACTIVE, laboratory_id: @course.laboratory_id)
@users = User.where(status: User::STATUS_ACTIVE)
@users = @users.where(laboratory_id: current_laboratory.id) unless current_laboratory.main_site?
@users = @users.where("concat(users.lastname, users.firstname) like '%#{name}%'") if name.present?
# REDO:Extension
@users = @users.joins(user_extension: :school).where("schools.name like '%#{school_name}%'") if school_name.present?
@ -1083,7 +1084,8 @@ class CoursesController < ApplicationController
school_name = params[:school_name]
# REDO:Extension
@users = User.where(status: User::STATUS_ACTIVE, laboratory_id: @course.laboratory_id)
@users = User.where(status: User::STATUS_ACTIVE)
@users = @users.where(laboratory_id: current_laboratory.id) unless current_laboratory.main_site?
@users = @users.where("concat(users.lastname, users.firstname) like '%#{name}%'") if name.present?
# REDO:Extension
@users = @users.joins(user_extension: :school).where("schools.name like '%#{school_name}%'") if school_name.present?

@ -919,6 +919,7 @@ class ShixunsController < ApplicationController
else
@users = User.none
end
@users = @users.where(laboratory_id: current_laboratory.id) unless current_laboratory.main_site?
page = params[:page] || 1
limit = params[:limit] || 20
@user_count = @users.count

@ -302,6 +302,7 @@ class SubjectsController < ApplicationController
member_ids = @subject.subject_members.map(&:user_id).join(',')
condition = "%#{params[:search].strip}%".gsub(" ","")
@users = User.where("id not in (?) and status = 1 and LOWER(concat(lastname, ifnull(firstname, ''), login)) LIKE ?", member_ids, "#{condition}")
@users = @users.where(laboratory_id: current_laboratory.id) unless current_laboratory.main_site?
@users = @users.page(page).per(10)
@users = @users.includes(:user_extension)

@ -3,6 +3,7 @@ class Users::RecentContactsController < Users::BaseController
def index
contacts = observed_user.recent_contacts.distinct
@contacts = contacts.where(laboratory_id: current_laboratory.id).order('private_messages.created_at DESC').limit(10).includes(:user_extension)
contacts = contacts.where(laboratory_id: current_laboratory.id) unless current_laboratory.main_site?
@contacts = contacts.order('private_messages.created_at DESC').limit(10).includes(:user_extension)
end
end

@ -2,7 +2,8 @@ class UsersForPrivateMessagesController < ApplicationController
before_action :require_login, :check_auth
def index
users = User.active.where.not(id: current_user.id).where(laboratory_id: current_laboratory.id)
users = User.active.where.not(id: current_user.id)
users = users.where(laboratory_id: current_laboratory.id) unless current_laboratory.main_site?
keyword = params[:keyword].to_s.strip
if keyword.blank?

Loading…
Cancel
Save