55 "database/sql"
66 "errors"
77 "fmt"
8- "github.com/davecgh/go-spew/spew"
98 "gorm.io/gorm"
109 "gorm.io/gorm/clause"
1110 "net/url"
@@ -675,7 +674,6 @@ func (afo *GormAdminFilterObjects) FilterQs(filterString string) {
675674
676675func (afo * GormAdminFilterObjects ) Search (field * Field , searchString string ) {
677676 fieldType := field .FieldType .Kind ()
678- spew .Dump (field .Name , fieldType )
679677 if fieldType == reflect .Ptr {
680678 fieldType = field .FieldType .Elem ().Kind ()
681679 }
@@ -723,7 +721,6 @@ func (afo *GormAdminFilterObjects) Search(field *Field, searchString string) {
723721 paginatedGormOperatorContext := NewGormOperatorContext (afo .GetPaginatedQuerySet (), model1 )
724722 for searchField := range adminPage .SearchFields .GetAll () {
725723 fieldType1 := searchField .Field .FieldType .Kind ()
726- spew .Dump (searchField .Field .Name , fieldType1 )
727724 if searchField .Field .FieldType .Kind () == reflect .Struct {
728725 afo .Search (searchField .Field , searchString )
729726 continue
@@ -743,7 +740,7 @@ func (afo *GormAdminFilterObjects) Search(field *Field, searchString string) {
743740 afo .SetPaginatedQuerySet (fullGormOperatorContext .Tx )
744741 afo .SetLastError (afo .PaginatedGormQuerySet .GetLastError ())
745742 } 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 ){
746- operator := IContainsGormOperator {}
743+ operator := ExactGormOperator {}
747744 gormOperatorContext := NewGormOperatorContext (afo .GetFullQuerySet (), afo .GetCurrentModel ())
748745 operator .Build (afo .GetUadminDatabase ().Adapter , gormOperatorContext , field , searchString , & SQLConditionBuilder {Type : "or" })
749746 afo .SetFullQuerySet (gormOperatorContext .Tx )
@@ -752,7 +749,7 @@ func (afo *GormAdminFilterObjects) Search(field *Field, searchString string) {
752749 afo .SetPaginatedQuerySet (gormOperatorContext .Tx )
753750 afo .SetLastError (afo .PaginatedGormQuerySet .GetLastError ())
754751 } else {
755- operator := ExactGormOperator {}
752+ operator := IContainsGormOperator {}
756753 gormOperatorContext := NewGormOperatorContext (afo .GetFullQuerySet (), afo .GetCurrentModel ())
757754 operator .Build (afo .GetUadminDatabase ().Adapter , gormOperatorContext , field , searchString , & SQLConditionBuilder {Type : "or" })
758755 afo .SetFullQuerySet (gormOperatorContext .Tx )
0 commit comments