dev_home
jingquan huang 5 years ago
parent 26a42d048d
commit 59de2cd1fa

@ -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
# 排行榜

@ -5,7 +5,7 @@ end
# 相关路径
json.paths do
json.partial! 'subjects/subject', locals: {subjects: @relate_subject}
json.partial! 'subjects/subject', locals: {subjects: shixun.relation_path}
end
# 推荐实训

Loading…
Cancel
Save