|
|
|
@ -39,10 +39,10 @@ class UsersService
|
|
|
|
|
|
|
|
|
|
#显示用户
|
|
|
|
|
#id用户id
|
|
|
|
|
def show_user
|
|
|
|
|
def show_user(params)
|
|
|
|
|
@user = User.find(params[:id])
|
|
|
|
|
img_url = url_to_avatar(@user)
|
|
|
|
|
gender = user.user_extensions.gender.nil? ? 0 : user.user_extensions.gender
|
|
|
|
|
gender = @user.user_extensions.gender.nil? ? 0 : @user.user_extensions.gender
|
|
|
|
|
work_unit = ""
|
|
|
|
|
if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1
|
|
|
|
|
work_unit = @user.user_extensions.school.name unless @user.user_extensions.school.nil?
|
|
|
|
@ -52,8 +52,8 @@ class UsersService
|
|
|
|
|
work_unit = @user.firstname
|
|
|
|
|
end
|
|
|
|
|
location = ""
|
|
|
|
|
location << @user.user_extensions.location
|
|
|
|
|
location << @user.user_extensions.location_city
|
|
|
|
|
location << (@user.user_extensions.location || '')
|
|
|
|
|
location << (@user.user_extensions.location_city || '')
|
|
|
|
|
{:id => @user.id,:img_url =>img_url,:nickname => @user.login,:gender => gender,:work_unit => work_unit,:mail => @user.mail,:location => location,:brief_introduction => @user.user_extensions.brief_introduction}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|