|
|
@@ -1,10 +1,12 @@ |
|
|
|
package models |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"sort" |
|
|
|
"strings" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/timeutil" |
|
|
|
"xorm.io/builder" |
|
|
@@ -179,7 +181,7 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { |
|
|
|
|
|
|
|
func generateFilterCond(opts *SearchDatasetOptions, cond builder.Cond) builder.Cond { |
|
|
|
if len(opts.Keyword) > 0 { |
|
|
|
cond = cond.And(builder.Or(builder.Like{"dataset.title", opts.Keyword}, builder.Like{"dataset.description", opts.Keyword})) |
|
|
|
cond = cond.And(builder.Or(builder.Like{"LOWER(dataset.title)", strings.ToLower(opts.Keyword)}, builder.Like{"LOWER(dataset.description)", strings.ToLower(opts.Keyword)})) |
|
|
|
} |
|
|
|
|
|
|
|
if len(opts.Category) > 0 { |
|
|
|