|
|
|
@ -66,8 +66,8 @@ class Mailer < ActionMailer::Base
|
|
|
|
|
subject = "[ #{user.show_name} : #{l(:label_day_mail)}]"
|
|
|
|
|
@subject = " #{user.show_name} : #{date_to} #{l(:label_day_mail)}"
|
|
|
|
|
|
|
|
|
|
date_from = "#{date_from} 23:59:59"
|
|
|
|
|
date_to = "#{date_to} 23:59:59"
|
|
|
|
|
date_from = "#{date_from} 17:59:59"
|
|
|
|
|
date_to = "#{date_to} 17:59:59"
|
|
|
|
|
|
|
|
|
|
# 生成token用于直接点击登录
|
|
|
|
|
@user = user
|
|
|
|
@ -122,11 +122,11 @@ class Mailer < ActionMailer::Base
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
# 查询user在课程中发布的通知,项目中发的新闻
|
|
|
|
|
@course_news = News.find_by_sql("select DISTINCT n.* from news n
|
|
|
|
|
@course_news = (course_ids && !course_ids.empty?) ? News.find_by_sql("select DISTINCT n.* from news n
|
|
|
|
|
where n.course_id in (#{course_ids})
|
|
|
|
|
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
|
|
|
|
|
@project_news = News.find_by_sql("select DISTINCT n.* from news n where n.project_id in (#{project_ids})
|
|
|
|
|
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
|
|
|
|
|
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc") : []
|
|
|
|
|
@project_news = (project_ids && !project_ids.empty?) ? News.find_by_sql("select DISTINCT n.* from news n where n.project_id in (#{project_ids})
|
|
|
|
|
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc") : []
|
|
|
|
|
|
|
|
|
|
# 查询user在课程及个人中留言
|
|
|
|
|
@course_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT * from journals_for_messages where
|
|
|
|
|