Skip to content
This repository was archived by the owner on Jan 10, 2022. It is now read-only.

Commit 32b1dfd

Browse files
minor fix
1 parent 0e216dc commit 32b1dfd

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

core/gorm_persistence_storage.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -723,11 +723,17 @@ func (afo *GormAdminFilterObjects) Search(field *Field, searchString string) {
723723
if searchField.Field.FieldType.Kind() == reflect.Struct {
724724
afo.Search(searchField.Field, searchString)
725725
continue
726+
} else if (fieldType == reflect.Uint) || (fieldType == reflect.Uint64) || (fieldType == reflect.Uint32) || (fieldType == reflect.Int64) || (fieldType == reflect.Int) || (fieldType == reflect.Int32) || (fieldType == reflect.Float32) || (fieldType == reflect.Float64) {
727+
operator := ExactGormOperator{}
728+
operator.Build(afo.GetUadminDatabase().Adapter, fullGormOperatorContext, searchField.Field, searchString, &SQLConditionBuilder{Type: "or"})
729+
operator = ExactGormOperator{}
730+
operator.Build(afo.GetUadminDatabase().Adapter, paginatedGormOperatorContext, searchField.Field, searchString, &SQLConditionBuilder{Type: "or"})
731+
} else {
732+
operator := IContainsGormOperator{}
733+
operator.Build(afo.GetUadminDatabase().Adapter, fullGormOperatorContext, searchField.Field, searchString, &SQLConditionBuilder{Type: "or"})
734+
operator = IContainsGormOperator{}
735+
operator.Build(afo.GetUadminDatabase().Adapter, paginatedGormOperatorContext, searchField.Field, searchString, &SQLConditionBuilder{Type: "or"})
726736
}
727-
operator := IContainsGormOperator{}
728-
operator.Build(afo.GetUadminDatabase().Adapter, fullGormOperatorContext, searchField.Field, searchString, &SQLConditionBuilder{Type: "or"})
729-
operator = IContainsGormOperator{}
730-
operator.Build(afo.GetUadminDatabase().Adapter, paginatedGormOperatorContext, searchField.Field, searchString, &SQLConditionBuilder{Type: "or"})
731737
}
732738
afo.SetFullQuerySet(fullGormOperatorContext.Tx)
733739
afo.SetPaginatedQuerySet(fullGormOperatorContext.Tx)

0 commit comments

Comments
 (0)