From 3988538ea4d4cd79b2e55e2d68e5fb16d9412f5a Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 20 Jun 2022 09:43:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/dataset.go | 9 --------- routers/home.go | 4 +--- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/models/dataset.go b/models/dataset.go index 53b63185f..54f89acf8 100755 --- a/models/dataset.go +++ b/models/dataset.go @@ -181,7 +181,6 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { if len(opts.DatasetIDs) > 0 { subCon := builder.NewCond() subCon = subCon.And(builder.In("dataset.id", opts.DatasetIDs)) - subCon = generateFilterCond(opts, subCon) cond = cond.Or(subCon) } @@ -462,11 +461,3 @@ func GetCollaboratorDatasetIdsByUserID(userID int64) []int64 { Cols("dataset.id").Find(&datasets) return datasets } - -func GetTeamDatasetIdsByUserID(userID int64) []int64 { - var datasets []int64 - _ = x.Table("dataset").Join("INNER", "team_repo", "dataset.repo_id = team_repo.repo_id"). - Join("INNER", "team_user", "team_repo.team_id=team_user.team_id and team_user.uid=?", userID). - Cols("dataset.id").Find(&datasets) - return datasets -} diff --git a/routers/home.go b/routers/home.go index 8829e26f4..1ed5faaa8 100755 --- a/routers/home.go +++ b/routers/home.go @@ -345,9 +345,7 @@ func ExploreDatasets(ctx *context.Context) { var datasetsIds []int64 if ownerID > 0 { - collaboratorDatasetsIds := models.GetCollaboratorDatasetIdsByUserID(ownerID) - teamDatasetsIds := models.GetTeamDatasetIdsByUserID(ownerID) - datasetsIds = append(collaboratorDatasetsIds, teamDatasetsIds...) + datasetsIds = models.GetCollaboratorDatasetIdsByUserID(ownerID) } opts := &models.SearchDatasetOptions{