Skip to content

Commit 35116ed

Browse files
committed
Merge pull request yajra#244 from lisa-fehr/patch-2
added a getColumnName
2 parents 7184562 + 4706cfc commit 35116ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/yajra/Datatables/Datatables.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,14 +681,15 @@ private function doOrdering()
681681
if (! empty($column['name'])) {
682682
$this->query->orderBy($column['name'], $order_dir);
683683
} elseif (isset($this->columns[$order_col])) {
684-
$this->query->orderBy($this->columns[$order_col], $order_dir);
684+
$column_name = $this->getColumnName($this->columns[$order_col]);
685+
$this->query->orderBy($column_name, $order_dir);
685686
}
686687
}
687688
} else {
688689
if (isset($this->columns[$order_col])) {
689690
if ($this->input['columns'][$order_col]['orderable'] == "true") {
690-
$column = $this->getColumnName($this->columns[$order_col]);
691-
$this->query->orderBy($column, $order_dir);
691+
$column_name = $this->getColumnName($this->columns[$order_col]);
692+
$this->query->orderBy($column_name, $order_dir);
692693
}
693694
}
694695
}

0 commit comments

Comments
 (0)