所属课程

dev_home
jingquan huang 5 years ago
parent 1ebd0c1f7b
commit 001a2e69ed

@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}

@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}

@ -186,6 +186,12 @@ 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}")
else
@relate_subject = @shixun.subjects.visible.unhidden.uniq.joins(:laboratory_subjects).where(laboratory_subjects: { laboratory_id: current_laboratory.id })
end
end
# 排行榜

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

Loading…
Cancel
Save