This commit is contained in:
2023-12-26 17:40:48 +08:00
parent ea8060b047
commit 609e5d4749
+3
View File
@@ -89,6 +89,9 @@ class ActiveQuery extends QueryTrait implements ISqlBuilder
*/ */
public function chunk(int $size, Closure $closure): void public function chunk(int $size, Closure $closure): void
{ {
if ($this->offset === -1) {
$this->offset = 0;
}
$data = $this->offset($this->offset)->limit($size)->get(); $data = $this->offset($this->offset)->limit($size)->get();
if (!$data || $data->isEmpty()) { if (!$data || $data->isEmpty()) {
return; return;