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 42cba7f commit dbde111Copy full SHA for dbde111
src/QueryDataTable.php
@@ -673,10 +673,14 @@ protected function hasOrderColumn($column)
673
*/
674
protected function applyOrderColumn($column, $orderable)
675
{
676
- $sql = $this->columnDef['order'][$column]['sql'];
677
- $sql = str_replace('$1', $orderable['direction'], $sql);
678
- $bindings = $this->columnDef['order'][$column]['bindings'];
679
- $this->query->orderByRaw($sql, $bindings);
+ $sql = $this->columnDef['order'][$column]['sql'];
+ if (is_callable($sql)) {
+ call_user_func($sql, $this->query, $orderable['direction']);
+ } else {
680
+ $sql = str_replace('$1', $orderable['direction'], $sql);
681
+ $bindings = $this->columnDef['order'][$column]['bindings'];
682
+ $this->query->orderByRaw($sql, $bindings);
683
+ }
684
}
685
686
/**
0 commit comments