Skip to content

Commit

Permalink
Merge pull request bgultekin#124 from alessandropietrobelli/master
Browse files Browse the repository at this point in the history
Another Undefined Offset
  • Loading branch information
Kamil Tunkiewicz committed Jul 25, 2014
2 parents 485c1e0 + e7a7c5d commit d4316ef
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Bllim/Datatables/Datatables.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,16 @@ protected function filtering()
$cast_end = " as TEXT)";
}

$column = $db_prefix . $columns_clean[$i];
// When there's an added column during filtering DT return it and the number of $this->input['search'] is greater than $columns_clean
if (count($columns_clean) > $i)
{
$column = $db_prefix . $columns_clean[$i];

if(Config::get('datatables.search.case_insensitive', false)) {
$query->orwhere(DB::raw('LOWER('.$cast_begin.$column.$cast_end.')'), 'LIKE', strtolower($keyword));
} else {
$query->orwhere(DB::raw($cast_begin.$column.$cast_end), 'LIKE', $keyword);
if(Config::get('datatables.search.case_insensitive', false)) {
$query->orwhere(DB::raw('LOWER('.$cast_begin.$column.$cast_end.')'), 'LIKE', strtolower($keyword));
} else {
$query->orwhere(DB::raw($cast_begin.$column.$cast_end), 'LIKE', $keyword);
}
}
}
}
Expand Down

0 comments on commit d4316ef

Please sign in to comment.