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,10 +262,12 @@ class UsersController < ApplicationController
# modified by fq
def user_newfeedback
jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
if User.current == @user
jours.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
@jour = paginateHelper jours,10
@state = false
render :layout=>'base_users_new'

View File

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