Merge remote-tracking branch 'origin/szzh' into szzh

This commit is contained in:
lizanle 2015-08-11 11:30:23 +08:00
commit 51f71d1081
2 changed files with 8 additions and 5 deletions

View File

@ -262,9 +262,11 @@ class UsersController < ApplicationController
# modified by fq # modified by fq
def user_newfeedback def user_newfeedback
jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
jours.update_all(:is_readed => true, :status => false) if User.current == @user
jours.each do |journal| jours.update_all(:is_readed => true, :status => false)
fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false) jours.each do |journal|
fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
end
end end
@jour = paginateHelper jours,10 @jour = paginateHelper jours,10
@state = false @state = false

View File

@ -291,9 +291,10 @@ class User < Principal
name name
end end
## end ## end
# 查询用户未读过的记录
def count_new_jour def count_new_jour
count = self.new_jours.count count = self.journals_for_messages.where("status=?", 1).count
end end
#added by nie #added by nie