|
|
@ -14,12 +14,14 @@ module UserDecorator
|
|
|
|
|
|
|
|
|
|
|
|
# 关注数
|
|
|
|
# 关注数
|
|
|
|
def follow_count
|
|
|
|
def follow_count
|
|
|
|
User.watched_by(id).count
|
|
|
|
Watcher.where(user_id: id, watchable_type: %w(Principal User)).count
|
|
|
|
|
|
|
|
# User.watched_by(id).count
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# 粉丝数
|
|
|
|
# 粉丝数
|
|
|
|
def fan_count
|
|
|
|
def fan_count
|
|
|
|
watchers.count
|
|
|
|
Watcher.where(watchable_type: %w(Principal User), watchable_id: id).count
|
|
|
|
|
|
|
|
# watchers.count
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# 是否绑定邮箱
|
|
|
|
# 是否绑定邮箱
|
|
|
|