Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Remove a useless fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
zhwei authored Sep 13, 2016
1 parent 8f3e33a commit d4b5822
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/DataSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,19 @@ public function build()

case "query":
case "model":
$this->total_rows = $this->query->count();
//orderby
if (isset($this->orderby)) {
$this->query = $this->query->orderBy($this->orderby[0], $this->orderby[1]);
}

//limit-offset
if (isset($this->limit)){

$this->paginator = $this->query->paginate($this->limit, ['*'], 'page'.$this->cid);
$this->data = $this->paginator;
$this->total_rows = $this->paginator->total();
} else {
$this->data = $this->query->get();
$this->total_rows = count($this->data);
}

break;
Expand Down

0 comments on commit d4b5822

Please sign in to comment.