diff --git a/src/DataSet.php b/src/DataSet.php index d5c85736..f8bcc2d8 100644 --- a/src/DataSet.php +++ b/src/DataSet.php @@ -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;