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? %>