功能:按资源配置平台列表搜索

This commit is contained in:
czl231
2026-08-11 22:22:36 +08:00
parent 8d6ffca1e2
commit 95d0f7dc54
19 changed files with 741 additions and 62 deletions

View File

@@ -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