This commit is contained in:
yuanke 2016-10-26 14:44:44 +08:00
parent e7bd24b552
commit 513be115cd
1 changed files with 1 additions and 3 deletions

View File

@ -188,12 +188,11 @@ class News < ActiveRecord::Base
def delay_news_wechat_send
if self.course
self.delay(:queue => 'high_priority',priority: -1).news_wechat_message
self.delay.news_wechat_message
end
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)
@ -201,7 +200,6 @@ 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