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

This commit is contained in:
ouyangxuhua 2015-08-20 08:38:50 +08:00
commit 246594db40
2 changed files with 5 additions and 4 deletions

View File

@ -114,9 +114,10 @@ class UsersController < ApplicationController
when nil
@user_course_messages = @user.course_messages.reverse
@user_forge_messages = @user.forge_messages.reverse
@user_forum_messages = @user.forum_messages.reverse
@user_memo_messages = @user.memo_messages.reverse
@user_course_messages_count = @user_course_messages.count
@user_forge_messages_count = @user_forum_messages.count
@user_memo_messages_count = @user_memo_messages.count
when 'homework'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count

View File

@ -204,7 +204,7 @@ class JournalsForMessage < ActiveRecord::Base
# 主留言
receivers = []
if self.reply_id == 0
if self.author_id != self.jour_id # 过滤自己给自己的留言消息
if self.user_id != self.jour_id # 过滤自己给自己的留言消息
receivers << self.jour
end
else # 回帖
@ -218,8 +218,8 @@ class JournalsForMessage < ActiveRecord::Base
end
end
if self.jour_type == 'Principal'
if self.user_id != self.jour.user_id
self.user_feedback_messages << UserFeedbackMessage.new(:user_id => self.jour.user_id, :memo_message_id => self.id, :memo_message_type => "Forum", :viewed => false)
if self.user_id != self.jour_id
self.user_feedback_messages << UserFeedbackMessage.new(:user_id => self.jour_id, :user_message_id => self.id, :user_message_type => "Forum", :viewed => false)
end
end
end