File tree 1 file changed +22
-1
lines changed 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,13 @@ class QueryDataTable extends DataTableAbstract
51
51
* @var bool
52
52
*/
53
53
protected $ skipTotalRecords = false ;
54
+
55
+ /**
56
+ * Flag to keep the select bindings.
57
+ *
58
+ * @var bool
59
+ */
60
+ protected $ keepSelectBindings = false ;
54
61
55
62
/**
56
63
* Can the DataTable engine be created with these parameters.
@@ -130,6 +137,18 @@ public function skipTotalRecords()
130
137
131
138
return $ this ;
132
139
}
140
+
141
+ /**
142
+ * Keep the select bindings.
143
+ *
144
+ * @return $this
145
+ */
146
+ public function keepSelectBindings ()
147
+ {
148
+ $ this ->keepSelectBindings = true ;
149
+
150
+ return $ this ;
151
+ }
133
152
134
153
/**
135
154
* Count total items.
@@ -187,7 +206,9 @@ protected function prepareCountQuery()
187
206
if (! $ this ->isComplexQuery ($ builder )) {
188
207
$ row_count = $ this ->wrap ('row_count ' );
189
208
$ builder ->select ($ this ->connection ->raw ("'1' as {$ row_count }" ));
190
- $ builder ->setBindings ([], 'select ' );
209
+ if (! $ this ->keepSelectBindings ) {
210
+ $ builder ->setBindings ([], 'select ' );
211
+ }
191
212
}
192
213
193
214
return $ builder ;
You can’t perform that action at this time.
0 commit comments