diff --git a/ActiveQuery.php b/ActiveQuery.php index d31456e..b6e1a66 100644 --- a/ActiveQuery.php +++ b/ActiveQuery.php @@ -89,6 +89,9 @@ class ActiveQuery extends QueryTrait implements ISqlBuilder */ public function chunk(int $size, Closure $closure): void { + if ($this->offset === -1) { + $this->offset = 0; + } $data = $this->offset($this->offset)->limit($size)->get(); if (!$data || $data->isEmpty()) { return;