This commit is contained in:
parent
e7bd24b552
commit
513be115cd
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue