@@ -4973,7 +4973,7 @@ this.recline.View = this.recline.View || {};
49734973 for ( const [ key , value ] of Object . entries ( filters ) ) {
49744974 let single_where_statament = "" ;
49754975 value . forEach ( ( value_item ) => {
4976- if ( this . get_field_type ( fields , key ) == "num" ) {
4976+ if ( this . get_field_type ( value_item ) == "num" ) {
49774977 single_where_statament += `${ key } = ${ value_item } OR ` ;
49784978 } else {
49794979 single_where_statament += `${ key } = "${ value_item } " OR ` ;
@@ -4988,7 +4988,7 @@ this.recline.View = this.recline.View || {};
49884988 if ( q != "" ) {
49894989 let where_q = "" ;
49904990 for ( const [ key , value ] of Object . entries ( filters ) ) {
4991- if ( this . get_field_type ( fields , key ) == "string" ) {
4991+ if ( this . get_field_type ( value ) == "string" ) {
49924992 where_q_str += ` LOWER(${ key } ) like LOWER("${ value . slice (
49934993 0 ,
49944994 - 2
@@ -5005,20 +5005,16 @@ this.recline.View = this.recline.View || {};
50055005 }
50065006 return where_str ;
50075007 } ,
5008- get_field_type : function ( fields , key ) {
5009- let string_types = [ "STRING" ] ;
5010- let field_type = [ ] ;
5011- fields . forEach ( ( lfield ) => {
5012- if ( lfield [ "id" ] === key ) {
5013- field_type = lfield [ "type" ] ;
5014- }
5015- } ) ;
5016-
5017- if ( field_type [ 0 ] in string_types ) {
5008+ get_field_type : function ( value ) {
5009+
5010+ if ( typeof value == "string" ) {
50185011 return "string" ;
5019- } else {
5020- return "num" ;
50215012 }
5013+
5014+ if ( typeof value == "number" ) {
5015+ return "num"
5016+ }
5017+
50225018 } ,
50235019 } ) ;
50245020} ) ( jQuery , recline . View ) ;
0 commit comments