From fc40905fdf7638380b7b2c3ef6fe3be770d67f65 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 11 Jul 2019 14:33:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=AF=84=E8=AE=BA=E6=8A=A550?= =?UTF-8?q?0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/discusses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/discusses_controller.rb b/app/controllers/discusses_controller.rb index c09e9e285..f100ac233 100644 --- a/app/controllers/discusses_controller.rb +++ b/app/controllers/discusses_controller.rb @@ -14,7 +14,7 @@ class DiscussesController < ApplicationController .where("discusses.user_id = games.user_id").select("discusses.*, games.identifier") else disscusses = Discuss.where("dis_id = :dis_id and dis_type = :dis_type and root_id is null and - (hidden = :hidden or user_id = :user_id)", + (discusses.hidden = :hidden or discusses.user_id = :user_id)", {dis_id: @container.id, dis_type: @container.class.to_s, hidden: false, user_id: current_user.id}) .joins(challenge: :games).where("discusses.user_id = games.user_id").select("discusses.*, games.identifier") @disscuss_count = disscusses.count("discusses.id")