|
|
@@ -107,6 +107,7 @@ type SearchDatasetOptions struct { |
|
|
|
Category string |
|
|
|
Task string |
|
|
|
License string |
|
|
|
DatasetIDs []int64 |
|
|
|
ListOptions |
|
|
|
SearchOrderBy |
|
|
|
IsOwner bool |
|
|
@@ -177,6 +178,12 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if len(opts.DatasetIDs) > 0 { |
|
|
|
subCon := builder.NewCond() |
|
|
|
subCon = subCon.And(builder.In("dataset.id", opts.DatasetIDs)) |
|
|
|
cond = cond.Or(subCon) |
|
|
|
} |
|
|
|
|
|
|
|
return cond |
|
|
|
} |
|
|
|
|
|
|
@@ -447,3 +454,11 @@ func IncreaseDownloadCount(datasetID int64) error { |
|
|
|
|
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
func GetCollaboratorDatasetIdsByUserID(userID int64) []int64 { |
|
|
|
var datasets []int64 |
|
|
|
_ = 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) |
|
|
|
return datasets |
|
|
|
|
|
|
|
} |