From b462d23cdc42c40f2e0b4a8d48d5ed74801036c1 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 16:50:09 +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 3beee5731..6c867241b 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -54,11 +54,11 @@ namespace :sync do end if subject_id.to_i == -1 - discusses = Shixun.where(dis_id: shixun_id).where("parent_id is nul") + discusses = Shixun.where("parent_id is nul 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(dis_id: shixun_ids).where("parent_id is null") + discusses = Discuss.where("parent_id is nul and dis_id=?", shixun_ids) end discusses.each do |discuss|