留言报500
This commit is contained in:
parent
d845b14992
commit
5f50ad046c
|
@ -255,14 +255,16 @@ class JournalsForMessage < ActiveRecord::Base
|
||||||
self.course_messages << CourseMessage.new(:user_id => r, :course_id => self.jour.id, :viewed => false)
|
self.course_messages << CourseMessage.new(:user_id => r, :course_id => self.jour.id, :viewed => false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if self.jour_type == 'HomeworkCommon'
|
||||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.jour.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count
|
count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.jour.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count
|
||||||
if self.jour_type == 'HomeworkCommon' && count == 0
|
if count == 0
|
||||||
ws = WechatService.new
|
ws = WechatService.new
|
||||||
#content = truncate(strip_tags(self.notes.to_s), length: 200)
|
#content = truncate(strip_tags(self.notes.to_s), length: 200)
|
||||||
content = strip_html self.notes.html_safe, 200
|
content = strip_html self.notes.html_safe, 200
|
||||||
ws.comment_template self.jour.user_id, "homework", self.jour_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
ws.comment_template self.jour.user_id, "homework", self.jour_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# 用户留言消息通知
|
# 用户留言消息通知
|
||||||
|
|
Loading…
Reference in New Issue