Browse Source

提交代码

tags/v1.22.6.2^2
ychao_1983 3 years ago
parent
commit
3b70f26f69
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      models/dataset.go

+ 4
- 2
models/dataset.go View File

@@ -249,6 +249,10 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond {
subCon = generateFilterCond(opts, subCon)
cond = cond.Or(subCon)
}
} else {
if opts.StarByMe {
cond = cond.And(builder.Eq{"dataset.id": -1})
}
}

return cond
@@ -311,8 +315,6 @@ func SearchDatasetByCondition(opts *SearchDatasetOptions, cond builder.Cond) (Da
sess.Select(selectColumnsSql).Join("INNER", "repository", "repository.id = dataset.repo_id").
Join("INNER", "attachment", "attachment.dataset_id=dataset.id").
Where(cond).OrderBy(opts.SearchOrderBy.String())
a, _ := sess.LastSQL()
log.Warn("dataset sql:" + a)
if opts.PageSize > 0 {
sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize)
}


Loading…
Cancel
Save