异步发送微信消息加点日志

This commit is contained in:
yuanke 2016-10-26 13:46:23 +08:00
parent de5fb72ff3
commit 653f485064
1 changed files with 2 additions and 0 deletions

View File

@ -193,6 +193,7 @@ class News < ActiveRecord::Base
end
def news_wechat_message
logger.info 'start news_wechat_message!!!!!!!!'
self.course.members.each do |m|
if m.user_id != self.author_id
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
@ -200,6 +201,7 @@ class News < ActiveRecord::Base
if count == 0
ws = WechatService.new
content = self.title
logger.info 'send wechat message!!!!!!!'
ws.class_notice m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", self.course.name, self.author.show_name, format_time(self.created_on), content, "点击查看通知详情"
end
end