diff --git a/src/CollectionDataTable.php b/src/CollectionDataTable.php index 018b75e6..b8348824 100644 --- a/src/CollectionDataTable.php +++ b/src/CollectionDataTable.php @@ -231,7 +231,7 @@ protected function globalSearch($keyword) $data = $this->serialize($row); foreach ($this->request->searchableColumnIndex() as $index) { $column = $this->getColumnName($index, 'sort'); - $value = Arr::get($data, $column); + $value = Arr::get($data, $column); if (! $value || is_array($value)) { if (! is_numeric($value)) { continue; diff --git a/src/DataTableAbstract.php b/src/DataTableAbstract.php index 9e943ea9..80e043c0 100644 --- a/src/DataTableAbstract.php +++ b/src/DataTableAbstract.php @@ -939,9 +939,9 @@ protected function setupKeyword($value) /** * Get column name to be use for filtering and sorting. * - * @param int $index - * @param string|null $type - * @param bool $wantsAlias + * @param int $index + * @param string|null $type + * @param bool $wantsAlias * @return string */ protected function getColumnName($index, $type = null, $wantsAlias = false) diff --git a/src/Processors/DataProcessor.php b/src/Processors/DataProcessor.php index af026610..81de641d 100644 --- a/src/Processors/DataProcessor.php +++ b/src/Processors/DataProcessor.php @@ -189,19 +189,18 @@ protected function selectOnlyNeededColumns(array $data) { if (is_null($this->onlyColumns)) { return $data; - } else { - $results = []; - foreach ($this->onlyColumns as $onlyColumn) { - Arr::set($results, $onlyColumn, Arr::get($data, $onlyColumn)); - } - foreach ($this->exceptions as $exception) { - if ($column = Arr::get($data, $exception)) { - Arr::set($results, $exception, $column); - } + } + $results = []; + foreach ($this->onlyColumns as $onlyColumn) { + Arr::set($results, $onlyColumn, Arr::get($data, $onlyColumn)); + } + foreach ($this->exceptions as $exception) { + if ($column = Arr::get($data, $exception)) { + Arr::set($results, $exception, $column); } - - return $results; } + + return $results; } /** diff --git a/src/QueryDataTable.php b/src/QueryDataTable.php index 63b8d07d..70b0ac99 100644 --- a/src/QueryDataTable.php +++ b/src/QueryDataTable.php @@ -674,8 +674,8 @@ protected function defaultOrdering() $this->applyOrderColumn($column, $orderable); } else { $nullsLastSql = $this->getNullsLastSql($column, $orderable['direction']); - $normalSql = $this->wrap($column) . ' ' . $orderable['direction']; - $sql = $this->nullsLast ? $nullsLastSql : $normalSql; + $normalSql = $this->wrap($column) . ' ' . $orderable['direction']; + $sql = $this->nullsLast ? $nullsLastSql : $normalSql; $this->query->orderByRaw($sql); } }); diff --git a/src/Utilities/Request.php b/src/Utilities/Request.php index e22df653..738f5fcf 100644 --- a/src/Utilities/Request.php +++ b/src/Utilities/Request.php @@ -205,8 +205,8 @@ public function keyword() /** * Get column identity from input or database. * - * @param int $i - * @param string|null $type + * @param int $i + * @param string|null $type * @return string */ public function columnName($i, $type = null)