We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7184562 commit 75f7cb9Copy full SHA for 75f7cb9
src/yajra/Datatables/Datatables.php
@@ -327,9 +327,9 @@ private function count()
327
{
328
$query = $this->query;
329
330
- // if its a normal query ( no union ) replace the select with static text to improve performance
+ // if its a normal query ( no union or distinct ) replace the select with static text to improve performance
331
$myQuery = clone $query;
332
- if (! preg_match('/UNION/i', strtoupper($myQuery->toSql()))) {
+ if (! preg_match('/(UNION|DISTINCT)/i', strtoupper($myQuery->toSql()))) {
333
$myQuery->select($this->connection->raw("'1' as row_count"));
334
}
335
0 commit comments