Skip to content

Commit

Permalink
Merge pull request #169 from apizzini/fluent-bug-fix
Browse files Browse the repository at this point in the history
Fluent bug fix
  • Loading branch information
MarkVaughn committed Mar 5, 2015
2 parents 30d8619 + e6fe066 commit a697307
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Bllim/Datatables/Datatables.php
Expand Up @@ -361,9 +361,13 @@ protected function saveQuery($query)
$this->query = $query;
$this->query_type = $query instanceof \Illuminate\Database\Query\Builder ? 'fluent' : 'eloquent';
if ($this->dataFullSupport) {
$this->columns = array_map(function ($column) {
return trim(DB::connection()->getPdo()->quote($column['data']), "'");
}, $this->input['columns']);
if ($this->query_type == 'eloquent') {
$this->columns = array_map(function ($column) {
return trim(DB::connection()->getPdo()->quote($column['data']), "'");
}, $this->input['columns']);
} else {
$this->columns = ($this->query->columns ?: array());
}
} else {
$this->columns = $this->query_type == 'eloquent' ? ($this->query->getQuery()->columns ?: array()) : ($this->query->columns ?: array());
}
Expand Down Expand Up @@ -760,7 +764,7 @@ protected function filtering()

// column search
for ($i = 0, $c = count($this->input['columns']); $i < $c; $i++) {
if (isset($column_aliases[$i]) && $this->input['columns'][$i]['orderable'] == "true" && $this->input['columns'][$i]['search']['value'] != '') {
if (isset($column_aliases[$i]) && $this->input['columns'][$i]['searchable'] == "true" && $this->input['columns'][$i]['search']['value'] != '') {
// if filter column exists for this columns then use user defined method
if (isset($this->filter_columns[$column_aliases[$i]])) {

Expand Down

0 comments on commit a697307

Please sign in to comment.