@ -126,7 +125,7 @@ class Mailer < ActionMailer::Base
@homeworks=HomeworkAttach.where("user_id=#{user.id} and (created_at between '#{date_from}' and '#{date_to}')").order("created_at desc")
# 查询user在课程。项目中发布的讨论帖子
messages=Message.find_by_sql("select DISTINCT * from messages where (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
messages=Message.find_by_sql("select DISTINCT * from messages where author_id = #{user.id} and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
@course_messages||=[]
@project_messages||=[]
unlessmessages.first.nil?
@ -164,7 +163,7 @@ class Mailer < ActionMailer::Base
}
mylogger.debug"Sent activity mail : #{user.mail} - #{has_content}"
#有内容才发,没有不发
mail:to=>user.mail,:subject=>subjectifhas_content
mail:to=>user.mail,:subject=>subjectifhas_content
end
# 公共讨论区发帖、回帖添加邮件发送信息
@ -187,8 +186,8 @@ class Mailer < ActionMailer::Base