5
5
"database/sql"
6
6
"errors"
7
7
"fmt"
8
- "github.com/davecgh/go-spew/spew"
9
8
"gorm.io/gorm"
10
9
"gorm.io/gorm/clause"
11
10
"net/url"
@@ -675,7 +674,6 @@ func (afo *GormAdminFilterObjects) FilterQs(filterString string) {
675
674
676
675
func (afo * GormAdminFilterObjects ) Search (field * Field , searchString string ) {
677
676
fieldType := field .FieldType .Kind ()
678
- spew .Dump (field .Name , fieldType )
679
677
if fieldType == reflect .Ptr {
680
678
fieldType = field .FieldType .Elem ().Kind ()
681
679
}
@@ -723,7 +721,6 @@ func (afo *GormAdminFilterObjects) Search(field *Field, searchString string) {
723
721
paginatedGormOperatorContext := NewGormOperatorContext (afo .GetPaginatedQuerySet (), model1 )
724
722
for searchField := range adminPage .SearchFields .GetAll () {
725
723
fieldType1 := searchField .Field .FieldType .Kind ()
726
- spew .Dump (searchField .Field .Name , fieldType1 )
727
724
if searchField .Field .FieldType .Kind () == reflect .Struct {
728
725
afo .Search (searchField .Field , searchString )
729
726
continue
@@ -743,7 +740,7 @@ func (afo *GormAdminFilterObjects) Search(field *Field, searchString string) {
743
740
afo .SetPaginatedQuerySet (fullGormOperatorContext .Tx )
744
741
afo .SetLastError (afo .PaginatedGormQuerySet .GetLastError ())
745
742
} 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 {}
747
744
gormOperatorContext := NewGormOperatorContext (afo .GetFullQuerySet (), afo .GetCurrentModel ())
748
745
operator .Build (afo .GetUadminDatabase ().Adapter , gormOperatorContext , field , searchString , & SQLConditionBuilder {Type : "or" })
749
746
afo .SetFullQuerySet (gormOperatorContext .Tx )
@@ -752,7 +749,7 @@ func (afo *GormAdminFilterObjects) Search(field *Field, searchString string) {
752
749
afo .SetPaginatedQuerySet (gormOperatorContext .Tx )
753
750
afo .SetLastError (afo .PaginatedGormQuerySet .GetLastError ())
754
751
} else {
755
- operator := ExactGormOperator {}
752
+ operator := IContainsGormOperator {}
756
753
gormOperatorContext := NewGormOperatorContext (afo .GetFullQuerySet (), afo .GetCurrentModel ())
757
754
operator .Build (afo .GetUadminDatabase ().Adapter , gormOperatorContext , field , searchString , & SQLConditionBuilder {Type : "or" })
758
755
afo .SetFullQuerySet (gormOperatorContext .Tx )
0 commit comments