Browse Source

Merge branch 'V20220630' of git.openi.org.cn:OpenI/aiforge into grampus

pull/2379/head
lewis 3 years ago
parent
commit
760df0a3d5
4 changed files with 11 additions and 3 deletions
  1. +8
    -0
      models/dataset.go
  2. +0
    -1
      public/self/js/notebook/es5-shim.min.js
  3. +0
    -1
      public/self/js/notebook/purify.min.js
  4. +3
    -1
      routers/home.go

+ 8
- 0
models/dataset.go View File

@@ -181,6 +181,7 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond {
if len(opts.DatasetIDs) > 0 { if len(opts.DatasetIDs) > 0 {
subCon := builder.NewCond() subCon := builder.NewCond()
subCon = subCon.And(builder.In("dataset.id", opts.DatasetIDs)) subCon = subCon.And(builder.In("dataset.id", opts.DatasetIDs))
subCon = generateFilterCond(opts, subCon)
cond = cond.Or(subCon) cond = cond.Or(subCon)
} }


@@ -460,5 +461,12 @@ func GetCollaboratorDatasetIdsByUserID(userID int64) []int64 {
_ = x.Table("dataset").Join("INNER", "collaboration", "dataset.repo_id = collaboration.repo_id and collaboration.mode>0 and collaboration.user_id=?", userID). _ = x.Table("dataset").Join("INNER", "collaboration", "dataset.repo_id = collaboration.repo_id and collaboration.mode>0 and collaboration.user_id=?", userID).
Cols("dataset.id").Find(&datasets) Cols("dataset.id").Find(&datasets)
return 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
} }

+ 0
- 1
public/self/js/notebook/es5-shim.min.js
File diff suppressed because it is too large
View File


+ 0
- 1
public/self/js/notebook/purify.min.js
File diff suppressed because it is too large
View File


+ 3
- 1
routers/home.go View File

@@ -346,7 +346,9 @@ func ExploreDatasets(ctx *context.Context) {
var datasetsIds []int64 var datasetsIds []int64
if ownerID > 0 { if ownerID > 0 {


datasetsIds = models.GetCollaboratorDatasetIdsByUserID(ownerID)
collaboratorDatasetsIds := models.GetCollaboratorDatasetIdsByUserID(ownerID)
teamDatasetsIds := models.GetTeamDatasetIdsByUserID(ownerID)
datasetsIds = append(collaboratorDatasetsIds, teamDatasetsIds...)
} }


opts := &models.SearchDatasetOptions{ opts := &models.SearchDatasetOptions{


Loading…
Cancel
Save