|
|
|
@ -186,16 +186,6 @@ class ShixunsController < ApplicationController
|
|
|
|
|
#@fans_count = owner.fan_count
|
|
|
|
|
#@followed_count = owner.follow_count
|
|
|
|
|
@user_own_shixuns = owner.shixuns.published.count
|
|
|
|
|
## 云上实验室过滤
|
|
|
|
|
if current_laboratory.main_site?
|
|
|
|
|
# @relate_subject = @shixun.subjects.visible.unhidden.uniq.joins(:laboratory_subjects).where("laboratory_subjects.laboratory_id != #{current_laboratory.id}")
|
|
|
|
|
@relate_subject = @shixun.subjects.joins(:laboratory_subjects).where("laboratory_subjects.laboratory_id != #{current_laboratory.id} and
|
|
|
|
|
subjects.hidden=0 and subjects.status=2")
|
|
|
|
|
else
|
|
|
|
|
# @relate_subject = @shixun.subjects.visible.unhidden.uniq.joins(:laboratory_subjects).where(laboratory_subjects: { laboratory_id: current_laboratory.id })
|
|
|
|
|
@relate_subject = @shixun.subjects.joins(:laboratory_subjects).where("laboratory_subjects.laboratory_id != #{current_laboratory.id} and
|
|
|
|
|
subjects.hidden=0 and subjects.status=2")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 排行榜
|
|
|
|
|