Skip to content

Commit

Permalink
reintroducing eloquent/fluent check
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkVaughn committed Nov 22, 2013
1 parent 29c581a commit 97a05e0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Bllim/Datatables/Datatables.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,12 @@ public function database_prefix() {

private function count($count = 'count_all')
{
//Get columns to temp var.
$query_type = get_class($this->query) == 'Illuminate\Database\Query\Builder' ? 'fluent' : 'eloquent';
$query = $query_type == 'eloquent' ? $this->query->getQuery() : $this->query;
//Count the number of rows in the select
$this->$count = DB::table(DB::raw('('.$this->query->toSql().') AS count_row_table'))
->setBindings($this->query->getBindings())->count();
$this->$count = DB::table(DB::raw('('.$query->toSql().') AS count_row_table'))
->setBindings($query->getBindings())->count();
}


Expand Down

0 comments on commit 97a05e0

Please sign in to comment.