From 6b44b28c606c4fca458d1ba0fec0141de8cb0040 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Wed, 3 Jun 2020 18:31:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 4 ++-- dump.rdb | Bin 769764 -> 769763 bytes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 2d2e2ce26..f919ed1bf 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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 diff --git a/dump.rdb b/dump.rdb index 64f9e1903583c996bff2774a63afbdca44f7245f..2e340e1933866cf0208498368c1d01ab6d355cae 100644 GIT binary patch delta 115 zcmaFzSMTv(y$J?P=G7C8)S0hq>Q9VW0-~Ck8QYl|L6`}MnSq!Eh*^P{4T#x+m;;D8 zftYJMGb4BJ9%c)RUDGG;<#rSlFf_F^G_)`mOO-a#n< DQJx=U delta 116 zcmaF-SMSMRy$J?PTvZc|)R}!6wI;?a0a4A&jP1;fAj|~B%s|Wn#H>Kf2E^<@%mKul zK+LtBnUTA95A)jot