diff --git a/composer.json b/composer.json index cca75cb3..b661465d 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "yajra/laravel-datatables-oracle", + "name": "vladrub/laravel-datatables-oracle", "description": "jQuery DataTables API for Laravel 4|5", "keywords": [ "laravel", diff --git a/src/QueryDataTable.php b/src/QueryDataTable.php index 57264723..dc87f500 100644 --- a/src/QueryDataTable.php +++ b/src/QueryDataTable.php @@ -578,6 +578,11 @@ protected function defaultOrdering() }) ->each(function ($orderable) { $column = $this->resolveRelationColumn($orderable['name']); + + $parts = explode('.', $column); + if ( count($parts) == 1 ) { + $column = $this->query->getModel()->getTable() . '.' . $column; + } if ($this->hasOrderColumn($column)) { $this->applyOrderColumn($column, $orderable);