File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public function scopeSearch($query, $params)
6060 if (is_array ($ params )) {
6161 foreach ($ params as $ key => $ _param ) {
6262 $ param = [];
63- if (is_array ($ _param )) {
63+ if (is_array ($ _param ) && array_has ( $ _param , ' column ' ) && array_has ( $ _param , ' value ' ) ) {
6464 $ param ['column ' ] = array_get ($ _param , 'column ' , $ key );
6565 $ param ['operator ' ] = array_get ($ _param , 'operator ' , '= ' );
6666 $ param ['value ' ] = array_get ($ _param , 'value ' , null );
@@ -69,8 +69,16 @@ public function scopeSearch($query, $params)
6969 if ($ _param == null ) {
7070 continue ;
7171 }
72- $ param ['column ' ] = $ key ;
73- $ param ['operator ' ] = '= ' ;
72+
73+ if (stripos (': ' , $ key ) !== false ) {
74+ $ arr = explode (': ' , $ key );
75+ $ param ['column ' ] = $ arr [0 ];
76+ $ param ['operator ' ] = isset ($ arr [1 ]) ? $ arr [0 ] : '= ' ;
77+ } else {
78+ $ param ['column ' ] = $ key ;
79+ $ param ['operator ' ] = '= ' ;
80+ }
81+
7482 $ param ['value ' ] = $ _param ;
7583 }
7684
You can’t perform that action at this time.
0 commit comments