实训课程的访问数

dev_forum
daiao 5 years ago
parent af2f6ae95e
commit 841bd09f23

@ -18,7 +18,7 @@ class MyshixunsController < ApplicationController
# REDO等删除是否可以做成异步
# 前段需要按照操作过程提示
def reset_my_game
unless (current_user.admin? || current_user.id == @myshixun.user_id)
unless current_user.admin?
tip_exception("403", "")
end

@ -81,6 +81,9 @@ class SubjectsController < ApplicationController
@tags = ChallengeTag.where(challenge_id: challenge_ids).pluck(:name).uniq
# 用户获取的实训标签
@user_tags = @subject.shixuns.map(&:user_tags_name).flatten.uniq
# 访问数变更
@subject.increment!(:visits)
end
def create

Loading…
Cancel
Save