|
|
|
@@ -1,11 +1,11 @@ |
|
|
|
package models |
|
|
|
|
|
|
|
import ( |
|
|
|
logger "code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/timeutil" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"sort" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/timeutil" |
|
|
|
"xorm.io/builder" |
|
|
|
) |
|
|
|
|
|
|
|
@@ -198,6 +198,13 @@ func SearchDatasetByCondition(opts *SearchDatasetOptions, cond builder.Cond) (Da |
|
|
|
Join("INNER", "attachment", "attachment.dataset_id=dataset.id"). |
|
|
|
Where(cond).Count(new(Dataset)) |
|
|
|
|
|
|
|
a, b := sess.LastSQL() |
|
|
|
logger.Warn("sql:" + a) |
|
|
|
|
|
|
|
for _, v := range b { |
|
|
|
logger.Warn("arg:" + v.(string)) |
|
|
|
} |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
return nil, 0, fmt.Errorf("Count: %v", err) |
|
|
|
} |
|
|
|
@@ -205,6 +212,10 @@ 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, b = sess.LastSQL() |
|
|
|
logger.Warn("sql:" + a) |
|
|
|
|
|
|
|
print(a, b) |
|
|
|
if opts.PageSize > 0 { |
|
|
|
sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize) |
|
|
|
} |
|
|
|
|