|
|
|
@ -86,6 +86,16 @@ class SubjectsController < ApplicationController
|
|
|
|
|
@shixuns = @subject.shixuns.published.pluck(:id)
|
|
|
|
|
@courses = @subject.courses if @subject.excellent
|
|
|
|
|
|
|
|
|
|
@members = @subject.subject_members.includes(:user)
|
|
|
|
|
shixuns = @subject.shixuns.published.pluck(:id)
|
|
|
|
|
challenge_ids = Challenge.where(shixun_id: shixuns).pluck(:id)
|
|
|
|
|
# 实训路径中的所有实训标签
|
|
|
|
|
@tags = ChallengeTag.where(challenge_id: challenge_ids).pluck(:name).uniq
|
|
|
|
|
# 用户获取的实训标签
|
|
|
|
|
# @user_tags = @subject.shixuns.map(&:user_tags_name).flatten.uniq
|
|
|
|
|
@user_tags = user_shixun_tags challenge_ids, @user.id
|
|
|
|
|
@my_subject_progress = @subject.my_subject_progress
|
|
|
|
|
|
|
|
|
|
# 访问数变更
|
|
|
|
|
@subject.increment!(:visits)
|
|
|
|
|
end
|
|
|
|
|