功能:按资源配置平台列表搜索
This commit is contained in:
@@ -141,6 +141,13 @@ func ApplyKeywordFilter(ctx *gin.Context, query *gorm.DB, model any) *gorm.DB {
|
||||
if keyword == "" {
|
||||
return query
|
||||
}
|
||||
if useConfiguredKeywordSearch(ctx) {
|
||||
conditions, arguments := configuredKeywordConditions(model, keyword)
|
||||
if len(conditions) == 0 {
|
||||
return query
|
||||
}
|
||||
return query.Where("("+strings.Join(conditions, " OR ")+")", arguments...)
|
||||
}
|
||||
columns := keywordColumns(model)
|
||||
if len(columns) == 0 {
|
||||
return query
|
||||
|
||||
Reference in New Issue
Block a user