Browse Source

update tag

v_grhhuang 9 months ago
parent
commit
22a0129c06
1 changed files with 2 additions and 2 deletions
  1. 2 2
      internal/model/tag_model.go

+ 2 - 2
internal/model/tag_model.go

@@ -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