File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,15 @@ abstract class BaseGridQuery
3636 */
3737 protected $ page = 1 ;
3838
39+ /**
40+ * Search operator.
41+ * Whether to use where or having in query to compare columns against search string.
42+ * Values: where, having.
43+ *
44+ * @var string
45+ */
46+ protected $ searchOperator = 'having ' ;
47+
3948 /**
4049 * Return the initialized specific query. This contains the joins logic and condition that make the query specific.
4150 *
@@ -262,10 +271,23 @@ public function searcher()
262271 $ this ->columnKeys (),
263272 true ,
264273 method_exists ($ this , 'sortColumns ' ) ? $ this ->sortColumns () : $ this ->columns (),
265- ' having '
274+ $ this -> searchOperator
266275 );
267276 }
268277
278+ /**
279+ * Set search operator.
280+ *
281+ * @param string $searchOperator
282+ * @return $this
283+ */
284+ public function setSearchOperator ($ searchOperator )
285+ {
286+ $ this ->searchOperator = $ searchOperator ;
287+
288+ return $ this ;
289+ }
290+
269291 /**
270292 * Initialize query.
271293 *
You can’t perform that action at this time.
0 commit comments