Skip to content

Commit

Permalink
Update QueryHelper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lphkxd authored Apr 23, 2023
1 parent fdacc4e commit fd23204
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DbHelper/QueryHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ private function setBetweenWhere($fields, $split = ' ', $alias = '#', $callback
*/
public function paginate($columns = ['*'], $callback = null)
{
$limit = (isset($this->data['limit']) && $this->data['limit'] > 0) ? $this->data['limit'] : 20;
$page = (isset($this->data['page'])) ? $this->data['page'] : 1;
$limit = (!empty($this->data['limit']) && $this->data['limit'] > 0) ? $this->data['limit'] : 20;
$page = (!empty($this->data['page'])) ? $this->data['page'] : 1;
$offset = ($page - 1) * $limit;
$new = clone $this->query;
$db = $this->query->offset($offset)->limit($limit);
Expand Down Expand Up @@ -298,4 +298,4 @@ public function get($columns = ['*'], $callback = null)
}
return $list;
}
}
}

0 comments on commit fd23204

Please sign in to comment.