|
|
|
@ -5,9 +5,9 @@ class Users::SubjectsController < Users::BaseController
|
|
|
|
|
## 云上实验室过滤
|
|
|
|
|
if current_laboratory.main_site?
|
|
|
|
|
not_subject_ids = Subject.joins(:laboratory_subjects).where("laboratory_subjects.laboratory_id != #{current_laboratory.id}")
|
|
|
|
|
@subjects = @subjects.where.not(id: not_subject_ids)
|
|
|
|
|
subjects = subjects.where.not(id: not_subject_ids)
|
|
|
|
|
else
|
|
|
|
|
@subjects = @subjects.joins(:laboratory_subjects).where(laboratory_subjects: { laboratory_id: current_laboratory.id })
|
|
|
|
|
subjects = subjects.joins(:laboratory_subjects).where(laboratory_subjects: { laboratory_id: current_laboratory.id })
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@count = subjects.count
|
|
|
|
|