From 9335c19b18c95995d4731c3f34875a1c30fa0a60 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 18 Jan 2022 09:37:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/repo_tag.go | 6 +++--- routers/org/home.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/models/repo_tag.go b/models/repo_tag.go index 76740bd76..895242bc5 100644 --- a/models/repo_tag.go +++ b/models/repo_tag.go @@ -41,7 +41,7 @@ type TagsDetail struct { TagId int64 TagName string TagLimit int - RepoList []Repository + RepoList []*Repository } func GetTagByID(id int64) (*OfficialTag, error) { @@ -141,8 +141,8 @@ func GetAllOfficialTagRepos(orgID int64, isOwner bool) ([]TagsDetail, error) { return result, nil } -func GetOfficialTagDetail(orgID, tagId int64) ([]Repository, error) { - t := make([]Repository, 0) +func GetOfficialTagDetail(orgID, tagId int64) ([]*Repository, error) { + t := make([]*Repository, 0) const SQLCmd = "select t2.* from official_tag_repos t1 inner join repository t2 on t1.repo_id = t2.id where t1.org_id = ? and t1.tag_id=? order by t2.updated_unix desc" if err := x.SQL(SQLCmd, orgID, tagId).Find(&t); err != nil { diff --git a/routers/org/home.go b/routers/org/home.go index b2c79a54f..aaafec9d8 100755 --- a/routers/org/home.go +++ b/routers/org/home.go @@ -158,7 +158,7 @@ func Home(ctx *context.Context) { if setting.Course.OrgName == org.Name { for _, tag := range tags { for _, repo := range tag.RepoList { - (&repo).GetCreator() + repo.GetCreator() } }