修改数量

This commit is contained in:
sylor_huang@126.com 2020-06-03 18:31:26 +08:00
parent fe8ad87c51
commit 6b44b28c60
2 changed files with 2 additions and 2 deletions

View File

@ -145,13 +145,13 @@ class User < ApplicationRecord
# 关注数
def follow_count
Watcher.where(user_id: 1, watchable_type: %w(User)).count
Watcher.where(user_id: self.id, watchable_type: %w(User)).count
# User.watched_by(id).count
end
# 粉丝数
def fan_count
Watcher.where(watchable_type: %w(User), watchable_id: id).count
Watcher.where(watchable_type: %w(User), watchable_id: self.id).count
# watchers.count
end

BIN
dump.rdb

Binary file not shown.