From 9d4194e7e437c4f40acd517e60d0b04387d269e2 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 5 Sep 2019 15:20:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E6=95=B0=E6=8D=AE=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=8A=A0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 00299cabc..e51917a2e 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -1,4 +1,4 @@ -# bundle exec rake sync:public_message args=149,2903 +# RAILS_ENV=production bundle exec rake sync:sigle_message args=3,-1,8848,48337,'2017-07-23','2017-10-31',1000 namespace :sync do if ENV['args'] subject_id = ENV['args'].split(",")[0] # 对应课程的id @@ -33,7 +33,7 @@ namespace :sync do 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").where(dis_id: shixun_ids) + discusses = Discuss.where("parent_id is null and created_at between '#{start_time}' and '#{end_time}'").where(dis_id: shixun_ids) end discusses.each do |discuss|