diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 3367e379..0222437e 100755 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -417,6 +417,12 @@ class ShixunsController < ApplicationController else @shixuns = @shixuns.order("shixuns.status = 2 desc, #{order} #{bsort}") end + + # 只有老师身份才能查看实训列表 + unless User.current.is_certification_teacher || User.current.admin? + @shixuns = @shixuns.where("status > ?", 1) + end + @obj_count = @shixuns.count @limit = 16 @is_remote = true diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a4ac1388..b564e2af 100755 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -939,7 +939,7 @@ class UsersController < ApplicationController @limit = 16 if 1 == @index # @shixuns_result = Shixun.where(:status => [2,3]).where("name like ?", "%#{@search}%").reorder("created_at desc") - @shixuns_result = Shixun.where("name like ? and hidden=0", "%#{@search}%").reorder("myshixuns_count desc") + @shixuns_result = Shixun.where("name like ? and hidden=0 and status = 2", "%#{@search}%").reorder("myshixuns_count desc") @shixuns_result_count = @shixuns_result.count @shixun_pages = Paginator.new @shixuns_result_count, @limit, params['page'] || 1 @offset ||= @shixun_pages.offset