|
|
@@ -113,7 +113,7 @@ func (m *TagModel) GetTagStats(ctx context.Context, tagId int64) (postCount, fol
|
|
|
}
|
|
|
|
|
|
// 获取关注数
|
|
|
- err = m.conn.WithContext(ctx).Model(&UserFollow{}).
|
|
|
+ err = m.conn.WithContext(ctx).Model(&UserFollowTag{}).
|
|
|
Where("tag_id = ? AND is_del = 0", tagId).
|
|
|
Count(&followCount).Error
|
|
|
if err != nil {
|
|
|
@@ -126,7 +126,7 @@ func (m *TagModel) GetTagStats(ctx context.Context, tagId int64) (postCount, fol
|
|
|
// IsTagFollowedByUser 检查用户是否关注了话题
|
|
|
func (m *TagModel) IsTagFollowedByUser(ctx context.Context, userId, tagId int64) (bool, error) {
|
|
|
var count int64
|
|
|
- err := m.conn.WithContext(ctx).Model(&UserFollow{}).
|
|
|
+ err := m.conn.WithContext(ctx).Model(&UserFollowTag{}).
|
|
|
Where("user_id = ? AND tag_id = ? AND is_del = 0", userId, tagId).
|
|
|
Count(&count).Error
|
|
|
return count > 0, err
|