From 59dcfcbb1a136f095806d2a02af71738dd188153 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 15 Jun 2015 17:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=82=AE=E4=BB=B6=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=EF=BC=88=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5=E3=80=81?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=96=B0=E9=97=BB=E3=80=81=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9B=9E=E5=A4=8D=EF=BC=89=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 4 +- .../mailer/send_for_user_activities.html.erb | 100 +++++++++++++++++- 2 files changed, 101 insertions(+), 3 deletions(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 352c1b41a..e19f58e47 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -110,7 +110,7 @@ class Mailer < ActionMailer::Base # issue回复 @issues_journals = Journal.find_by_sql("select j.* from journals j, members m, projects p, issues i where m.user_id = '#{user.id}' and p.id = m.project_id and i.project_id = p.id and j.journalized_id = i.id - and j.journalized_type='Issue' and (j.created_on between '#{date_from}' and '#{date_to}') order by updated_on desc") + and j.journalized_type='Issue' and (j.created_on between '#{date_from}' and '#{date_to}') order by created_on desc") # @bids 查询课程作业,包括老师发布的作业,以及user提交作业 # @attachments查询课程课件更新 @@ -194,7 +194,7 @@ class Mailer < ActionMailer::Base @memos = Memo.find_by_sql("select DISTINCT m.* from memos m, forums f where (m.author_id = #{user.id} or (m.forum_id = f.id and f.creator_id = #{user.id})) and (m.created_at between '#{date_from}' and '#{date_to}') order by m.created_at desc") - has_content = [@issues,@course_messages,@project_messages,@course_news,@project_news, + has_content = [@issues,@issues_journals,@course_messages,@project_messages,@course_news,@course_news_comments,@project_news,@project_news_comments, @course_journal_messages,@user_journal_messages,@project_journal_messages,@forums,@memos,@attachments,@bids,@wiki_contents].any? {|o| !o.empty?} mylogger.debug "Sent activity mail : #{user.mail} - #{has_content}" #有内容才发,没有不发 diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb index 21549be21..5c89be1b8 100644 --- a/app/views/mailer/send_for_user_activities.html.erb +++ b/app/views/mailer/send_for_user_activities.html.erb @@ -6,6 +6,7 @@ @course_journal_messages.first|| @course_messages.first || @attachments.first %>

<%= l(:label_course_overview)%>

+ <% unless @course_news.first.nil? %> <% end %> + + <% unless @course_news_comments.first.nil? %> + + <% end %> + <% unless @bids.empty? %> <% end %> + + + <% unless @issues_journals.first.nil? %> + + <% end %> + <% unless @project_messages.first.nil? %> <% end %> + + <% unless @project_news_comments.first.nil? %> + + <% end %> + <% unless @project_journal_messages.first.nil? %>