Browse Source

提交代码

tags/v1.22.8.2^2
ychao_1983 3 years ago
parent
commit
6af10b01fa
2 changed files with 4 additions and 2 deletions
  1. +2
    -1
      models/dataset.go
  2. +2
    -1
      routers/repo/dataset.go

+ 2
- 1
models/dataset.go View File

@@ -190,6 +190,7 @@ type SearchDatasetOptions struct {
JustNeedZipFile bool
NeedAttachment bool
UploadAttachmentByMe bool
QueryReference bool
}

func CreateDataset(dataset *Dataset) (err error) {
@@ -260,7 +261,7 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond {
}
}
if len(opts.DatasetIDs) > 0 {
if opts.StarByMe {
if opts.StarByMe || (opts.RepoID == 0 && opts.QueryReference) {
cond = cond.And(builder.In("dataset.id", opts.DatasetIDs))
} else {
subCon := builder.NewCond()


+ 2
- 1
routers/repo/dataset.go View File

@@ -573,7 +573,8 @@ func ReferenceDatasetData(ctx *context.Context) {
Page: 1,
PageSize: setting.RepoMaxReferenceDatasetNum,
},
SearchOrderBy: getSearchOrderByInValues(datasetIds),
SearchOrderBy: getSearchOrderByInValues(datasetIds),
QueryReference: true,
}
datasets, _, err := models.SearchDataset(opts)



Loading…
Cancel
Save