Skip to content

Commit 4e9bc1f

Browse files
authored
Merge pull request #3029 from Nacoma/issue/3010
#3010 - convert expressions to strings
2 parents cd684c1 + 7e48782 commit 4e9bc1f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/QueryDataTable.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,19 @@ protected function getColumnSearchKeyword(int $i, bool $raw = false): string
311311
return $this->setupKeyword($keyword);
312312
}
313313

314+
protected function getColumnNameByIndex(int $index): string
315+
{
316+
$name = (isset($this->columns[$index]) && $this->columns[$index] != '*')
317+
? $this->columns[$index]
318+
: $this->getPrimaryKeyName();
319+
320+
if ($name instanceof Expression) {
321+
$name = $name->getValue($this->query->getGrammar());
322+
}
323+
324+
return in_array($name, $this->extraColumns, true) ? $this->getPrimaryKeyName() : $name;
325+
}
326+
314327
/**
315328
* Apply filterColumn api search.
316329
*

0 commit comments

Comments
 (0)