diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 83ec54f8..b2761b60 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -324,9 +324,15 @@ class ShixunsController < ApplicationController @search_name = "#{sub.name} / #{tag.name}" end shixun_id = ShixunTagRepertoire.where(:tag_repertoire_id => tag).map(&:shixun_id) - @shixuns = Shixun.select([:id, :name, :user_id, :challenges_count, :visits, :status, :myshixuns_count, :trainee, :use_scope, :identifier, :image_text, :averge_star]).where(:id => shixun_id, :hidden => 0).includes(:challenges, :schools, :shixun_members, :users).order("status = 2 desc, publish_time asc") + @shixuns = Shixun.select([:id, :name, :user_id, :challenges_count, :visits, :status, :myshixuns_count, + :trainee, :use_scope, :identifier, :image_text, :averge_star]) + .where(:id => shixun_id, :hidden => 0).where("status != -1") + .includes(:challenges, :schools, :shixun_members, :users).order("status = 2 desc, publish_time asc") else - @shixuns = Shixun.select([:id, :name, :user_id, :challenges_count, :visits, :status, :myshixuns_count, :trainee, :use_scope, :identifier, :image_text, :averge_star]).where(:hidden => 0).includes(:challenges, :schools, :shixun_members, :users).order("status = 2 desc, publish_time asc") + @shixuns = Shixun.select([:id, :name, :user_id, :challenges_count, :visits, :status, :myshixuns_count, + :trainee, :use_scope, :identifier, :image_text, :averge_star]) + .where("status != ? and hidden = ?", -1, 0).includes(:challenges, :schools, :shixun_members, :users) + .order("status = 2 desc, publish_time asc") end # # 依据tag和语言推荐实训,如果tag不够,则依据语言推荐;语言不够,则取系统的三个 # @recommend_shixuns = Shixun.find_by_sql("select challenge_id from challenge_tags where name like