add: get user info unread total
This commit is contained in:
parent
8ad087820e
commit
a0b6041394
|
@ -91,6 +91,8 @@ class UsersController < ApplicationController
|
|||
def get_user_info
|
||||
begin
|
||||
@user = current_user
|
||||
result = Notice::Read::CountService.call(current_user.id)
|
||||
@message_unread_total = result.nil? ? 0 : result[2]["unread_notification"]
|
||||
# TODO 等消息上线再打开注释
|
||||
#@tidding_count = unviewed_tiddings(current_user) if current_user.present?
|
||||
rescue Exception => e
|
||||
|
|
|
@ -22,4 +22,4 @@ json.city @user.city
|
|||
json.custom_department @user.custom_department
|
||||
json.description @user.description
|
||||
json.(@user, :show_email, :show_department, :show_location)
|
||||
json.message_unread_total 5
|
||||
json.message_unread_total @message_unread_total
|
Loading…
Reference in New Issue