From c3f9bcd16e83797f54b23d1e4d2881af675d7d7b Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 17:30:53 +0800 Subject: [PATCH] .. --- lib/tasks/public_message.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index 94ca70d77..5b5a80e95 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -57,8 +57,8 @@ namespace :sync do discusses = Discuss.where("parent_id is null and dis_id=?", shixun_id) else shixun_ids = Shixun.find_by_sql("select shixun_id from stage_shixuns where stage_id in (select id from stages where - subject_id=#{subject_id}) ").map(&:shixun_id) - discusses = Discuss.where("parent_id is null and dis_id=?", shixun_ids) + subject_id=#{subject_id}) ").map(&:shixun_id) + discusses = Discuss.where("parent_id is null").where(dis_id: shixun_ids) end discusses.each do |discuss|