删除的实训首页还能显示

dev_local
daiao 6 years ago
parent 069fae6608
commit a01d30f142

@ -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

Loading…
Cancel
Save