From c5267eeffccba1fa91f34d9c0228ff6db4353983 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 2 Dec 2019 13:49:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E4=B8=8A=E5=AE=9E=E9=AA=8C=E5=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/home_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 92845f7b9..d0b8d67d9 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -20,8 +20,8 @@ class HomeController < ApplicationController shixuns = shixuns.where(homepage_show: true) subjects = subjects.where(homepage_show: true) else - shixuns = shixuns.joins(:laboratory_shixuns).where(laboratory_shixuns: { homepage: true }) - subjects = subjects.joins(:laboratory_subjects).where(laboratory_subjects: { homepage: true }) + shixuns = shixuns.joins(:laboratory_shixuns).where(laboratory_shixuns: { homepage: true, laboratory_id: current_laboratory.id}) + subjects = subjects.joins(:laboratory_subjects).where(laboratory_subjects: { homepage: true, laboratory_id: current_laboratory.id}) end @shixuns = shixuns.includes(:tag_repertoires, :challenges).limit(8)