diff --git a/DataTables-Editor-Server/Editor.cs b/DataTables-Editor-Server/Editor.cs index 5d63927..79d4186 100644 --- a/DataTables-Editor-Server/Editor.cs +++ b/DataTables-Editor-Server/Editor.cs @@ -1179,6 +1179,13 @@ internal HttpRequest Request() return _request; } + /// + /// Apply the global Where filter to the supplied Query + /// + internal void GetGlobalWhere(Query query) + { + _GetWhere(query); + } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Private methods diff --git a/DataTables-Editor-Server/SearchBuilderOptions.cs b/DataTables-Editor-Server/SearchBuilderOptions.cs index 959e123..52a403b 100644 --- a/DataTables-Editor-Server/SearchBuilderOptions.cs +++ b/DataTables-Editor-Server/SearchBuilderOptions.cs @@ -244,7 +244,8 @@ internal List> Exec(Field fieldIn, Editor editor, Lis var query = db.Query("select") .Table(this._table) .LeftJoin(_leftJoin); - + editor.GetGlobalWhere(query); + if(fieldIn.Apply("get") && fieldIn.GetValue() == null){ query .Get(this._value + " as value") diff --git a/DataTables-Editor-Server/SearchPaneOptions.cs b/DataTables-Editor-Server/SearchPaneOptions.cs index 0a83ec0..2ee4893 100644 --- a/DataTables-Editor-Server/SearchPaneOptions.cs +++ b/DataTables-Editor-Server/SearchPaneOptions.cs @@ -280,6 +280,7 @@ internal List> Exec(Field fieldIn, Editor editor, Lis .GroupBy(value) .Where(_where) .LeftJoin(join); + editor.GetGlobalWhere(q); if (viewTotal) { q.Get("COUNT(*) as total"); @@ -330,6 +331,7 @@ internal List> Exec(Field fieldIn, Editor editor, Lis .Distinct(true) .Table(table) .LeftJoin(join); + editor.GetGlobalWhere(entriesQuery); if (fieldIn.Apply("get") && fieldIn.GetValue() == null) { gettingCount = true;