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

Commit 0e216dc

Browse files
minor fix
1 parent 0ee7dff commit 0e216dc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/gorm_persistence_storage.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ func (afo *GormAdminFilterObjects) Search(field *Field, searchString string) {
732732
afo.SetFullQuerySet(fullGormOperatorContext.Tx)
733733
afo.SetPaginatedQuerySet(fullGormOperatorContext.Tx)
734734
afo.SetLastError(afo.PaginatedGormQuerySet.GetLastError())
735-
} else {
735+
} 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){
736736
operator := IContainsGormOperator{}
737737
gormOperatorContext := NewGormOperatorContext(afo.GetFullQuerySet(), afo.GetCurrentModel())
738738
operator.Build(afo.GetUadminDatabase().Adapter, gormOperatorContext, field, searchString, &SQLConditionBuilder{Type: "or"})
@@ -741,6 +741,15 @@ func (afo *GormAdminFilterObjects) Search(field *Field, searchString string) {
741741
operator.Build(afo.GetUadminDatabase().Adapter, gormOperatorContext, field, searchString, &SQLConditionBuilder{Type: "or"})
742742
afo.SetPaginatedQuerySet(gormOperatorContext.Tx)
743743
afo.SetLastError(afo.PaginatedGormQuerySet.GetLastError())
744+
} else {
745+
operator := ExactGormOperator{}
746+
gormOperatorContext := NewGormOperatorContext(afo.GetFullQuerySet(), afo.GetCurrentModel())
747+
operator.Build(afo.GetUadminDatabase().Adapter, gormOperatorContext, field, searchString, &SQLConditionBuilder{Type: "or"})
748+
afo.SetFullQuerySet(gormOperatorContext.Tx)
749+
gormOperatorContext = NewGormOperatorContext(afo.GetPaginatedQuerySet(), afo.GetCurrentModel())
750+
operator.Build(afo.GetUadminDatabase().Adapter, gormOperatorContext, field, searchString, &SQLConditionBuilder{Type: "or"})
751+
afo.SetPaginatedQuerySet(gormOperatorContext.Tx)
752+
afo.SetLastError(afo.PaginatedGormQuerySet.GetLastError())
744753
}
745754
}
746755

0 commit comments

Comments
 (0)