File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -361,9 +361,13 @@ protected function saveQuery($query)
361
361
$ this ->query = $ query ;
362
362
$ this ->query_type = $ query instanceof \Illuminate \Database \Query \Builder ? 'fluent ' : 'eloquent ' ;
363
363
if ($ this ->dataFullSupport ) {
364
- $ this ->columns = array_map (function ($ column ) {
365
- return trim (DB ::connection ()->getPdo ()->quote ($ column ['data ' ]), "' " );
366
- }, $ this ->input ['columns ' ]);
364
+ if ($ this ->query_type == 'eloquent ' ) {
365
+ $ this ->columns = array_map (function ($ column ) {
366
+ return trim (DB ::connection ()->getPdo ()->quote ($ column ['data ' ]), "' " );
367
+ }, $ this ->input ['columns ' ]);
368
+ } else {
369
+ $ this ->columns = ($ this ->query ->columns ?: array ());
370
+ }
367
371
} else {
368
372
$ this ->columns = $ this ->query_type == 'eloquent ' ? ($ this ->query ->getQuery ()->columns ?: array ()) : ($ this ->query ->columns ?: array ());
369
373
}
@@ -760,7 +764,7 @@ protected function filtering()
760
764
761
765
// column search
762
766
for ($ i = 0 , $ c = count ($ this ->input ['columns ' ]); $ i < $ c ; $ i ++) {
763
- if (isset ($ column_aliases [$ i ]) && $ this ->input ['columns ' ][$ i ]['orderable ' ] == "true " && $ this ->input ['columns ' ][$ i ]['search ' ]['value ' ] != '' ) {
767
+ if (isset ($ column_aliases [$ i ]) && $ this ->input ['columns ' ][$ i ]['searchable ' ] == "true " && $ this ->input ['columns ' ][$ i ]['search ' ]['value ' ] != '' ) {
764
768
// if filter column exists for this columns then use user defined method
765
769
if (isset ($ this ->filter_columns [$ column_aliases [$ i ]])) {
766
770
You can’t perform that action at this time.
0 commit comments