Merge branch 'dev_hjq' of http://repository.trustie.net/xianbo/trustie2 into dev_hjq

This commit is contained in:
ouyangxuhua 2015-08-20 11:08:41 +08:00
commit b256d0a24e
2 changed files with 5 additions and 3 deletions

View File

@ -131,6 +131,7 @@ class UsersController < ApplicationController
@user_course_messages_count = @user_course_messages.count
when 'forge_news'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count
when 'poll'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count

View File

@ -210,12 +210,13 @@ class JournalsForMessage < ActiveRecord::Base
else # 留言回复
# 添加留言回复人
# reply_to = User.find(self.reply_id)
if self.user_id != self.parent.user_id && self.user_id != self.reply_id # 如果回帖人不是用户自己
if self.user_id != self.parent.user_id && self.user_id != self.reply_id && self.user_id != self.jour_id# 如果回帖人不是用户自己
receivers << User.find(self.reply_id)
end
if self.user_id != self.parent.jour_id
receivers << self.parent.jour
end
# if self.user_id != self.parent.jour_id
# receivers << self.parent.jour
# end
end
if self.jour_type == 'Principal'
if self.user_id != self.jour_id