dev_course
p31729568 6 years ago
parent fe133afc09
commit d45e8da5b9

@ -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
# 是否绑定邮箱 # 是否绑定邮箱

Loading…
Cancel
Save