@shixuns=Shixun.joins(challenges::challenge_tags).where("shixuns.status = 2 and challenges_count = 1 and shixuns.id not in (#{none_shixun_ids.join(",")})").
@shixuns=Shixun.joins(challenges::challenge_tags).where("shixuns.status = 2 and challenges_count = 1 and shixuns.id not in (#{none_shixun_ids.join(",")})").uniq.
where("shixuns.name like ? or challenge_tags.name like ?","%#{search}%","%#{search}%").select{|shixun|shixun.challenges.where(:st=>1).count==0}