From d39ca502e639d727c20bfe2931604246401bf4aa Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 3 Mar 2022 14:54:17 +0800 Subject: [PATCH] #1250 fix bug --- models/topic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/topic.go b/models/topic.go index 8abc76b9c..0b19bc1f0 100644 --- a/models/topic.go +++ b/models/topic.go @@ -327,7 +327,7 @@ func SaveTopics(repoID int64, topicNames ...string) error { func GetOrgTopics(orgId int64) ([]Topic, error) { result := make([]Topic, 0) - sql := "select t.* from repository r " + + sql := "select distinct(t.*) from repository r " + "inner join repo_topic rt on rt.repo_id = r.id " + "inner join topic t on rt.topic_id = t.id " + "where r.owner_id = ? order by repo_count desc limit 50"