From 481209a95585525d2b5b6383921d6d97d45a0964 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 22 May 2019 10:56:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=81=E5=B8=88=E8=BA=AB=E4=BB=BD=E6=89=8D?= =?UTF-8?q?=E8=83=BD=E6=9F=A5=E7=9C=8B=E6=9C=AA=E5=8F=91=E5=B8=83=E7=9A=84?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index dab26ee3..3367e379 100755 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -332,6 +332,11 @@ class ShixunsController < ApplicationController # @recommend_shixuns = Shixun.find_by_sql("select challenge_id from challenge_tags where name like # CONCAT('%',(select name from challenge_tags where challenge_id in (select id from challenges where shixun_id=61)),'%')") + # 只有老师身份才能查看实训列表 + unless User.current.is_certification_teacher || User.current.admin? + @shixuns = @shixuns.where("status > ?", 1) + end + @obj_count = @shixuns.count @limit = 16 @is_remote = true