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

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyglazyrindev committed Nov 21, 2021
1 parent 0ee7dff commit 0e216dc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/gorm_persistence_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ func (afo *GormAdminFilterObjects) Search(field *Field, searchString string) {
afo.SetFullQuerySet(fullGormOperatorContext.Tx)
afo.SetPaginatedQuerySet(fullGormOperatorContext.Tx)
afo.SetLastError(afo.PaginatedGormQuerySet.GetLastError())
} else {
} 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){
operator := IContainsGormOperator{}
gormOperatorContext := NewGormOperatorContext(afo.GetFullQuerySet(), afo.GetCurrentModel())
operator.Build(afo.GetUadminDatabase().Adapter, gormOperatorContext, field, searchString, &SQLConditionBuilder{Type: "or"})
Expand All @@ -741,6 +741,15 @@ func (afo *GormAdminFilterObjects) Search(field *Field, searchString string) {
operator.Build(afo.GetUadminDatabase().Adapter, gormOperatorContext, field, searchString, &SQLConditionBuilder{Type: "or"})
afo.SetPaginatedQuerySet(gormOperatorContext.Tx)
afo.SetLastError(afo.PaginatedGormQuerySet.GetLastError())
} else {
operator := ExactGormOperator{}
gormOperatorContext := NewGormOperatorContext(afo.GetFullQuerySet(), afo.GetCurrentModel())
operator.Build(afo.GetUadminDatabase().Adapter, gormOperatorContext, field, searchString, &SQLConditionBuilder{Type: "or"})
afo.SetFullQuerySet(gormOperatorContext.Tx)
gormOperatorContext = NewGormOperatorContext(afo.GetPaginatedQuerySet(), afo.GetCurrentModel())
operator.Build(afo.GetUadminDatabase().Adapter, gormOperatorContext, field, searchString, &SQLConditionBuilder{Type: "or"})
afo.SetPaginatedQuerySet(gormOperatorContext.Tx)
afo.SetLastError(afo.PaginatedGormQuerySet.GetLastError())
}
}

Expand Down

0 comments on commit 0e216dc

Please sign in to comment.