From a7eff50c6114f8c253e99b2d6d64a6bf5e368e91 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 27 Aug 2015 10:32:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=95=99=E8=A8=80=E5=8F=91?= =?UTF-8?q?=E9=80=81=EF=BC=9A=E5=9B=9E=E5=A4=8D=E4=B8=9C=E5=AE=B6=EF=BC=8C?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E4=BA=BA=E5=92=8C=E4=B8=9C=E5=AE=B6=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E4=B8=80=E4=BA=BA=E6=94=B6=E5=88=B0=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journals_for_message.rb | 24 +----------------------- app/models/user.rb | 1 + 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 1f5f2e1a6..6f775e7a2 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -212,33 +212,11 @@ class JournalsForMessage < ActiveRecord::Base if self.user_id != self.reply_id # 添加我回复的那个人 receivers << reply_to end - if self.user_id != self.parent.jour_id # 给东家发信息 + if self.user_id != self.parent.jour_id && self.reply_id != self.parent.jour_id # 给东家发信息,如果回复的对象是东家则不发 receivers << self.parent.jour end - # if self.user_id != self.parent.user_id - # receivers << reply_to - # if self.reply_id != self.parent.user_id - # receivers << self.parent.user - # end - # else - # receivers << reply_to - # end - - # 添加留言回复人 - #reply_to = User.find(self.reply_id) - #if self.user_id != self.parent.user_id && self.user_id != self.parent.jour_id # 如果回帖人不是用户自己 - # receivers << self.parent.user - # if self.reply_id != self.parent.user_id - # receivers << reply_to - # end - #else # 用户自己回复别人的,别人收到消息通知 - # if self.user_id != self.reply_id # 过滤掉自己回复自己的 - # receivers << reply_to - # end - #end end if self.jour_type == 'Principal' - receivers.each do |r| self.user_feedback_messages << UserFeedbackMessage.new(:user_id => r.id, :journals_for_message_id => self.id, :journals_for_message_type => "Principal", :viewed => false) end diff --git a/app/models/user.rb b/app/models/user.rb index 61dd60eec..b08b29981 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -263,6 +263,7 @@ class User < Principal user_memo_count = MemoMessage.where("user_id =? and viewed =?", User.current.id, 0).count messages_count = course_count + forge_count + user_feedback_count + user_memo_count end + # 查询指派给我的缺陷记录 def issue_status_update self.status_updates