src/Leevel/Database/Select.php
public function chunk(int $count, Closure $chunk): void
    {
        $result = $this->forPage($page = 1, $count)->

        findAll();

        while (count($result) > 0) {
            if (false === $chunk($result, $page)) {
                break;
            }

            $page++;

            $result = $this
                ->forPage($page, $count)
                ->findAll();
        }
    }
public function chunk(int $count, Closure $chunk): void
    {
        $result = $this->forPage($page = 1, $count)->

        findAll();

        while (count($result) > 0) {
            if (false === $chunk($result, $page)) {
                break;
            }

            $page++;

            $result = $this
                ->forPage($page, $count)
                ->findAll();
        }
    }
数据分块处理.

@param int      $count
@param \Closure $chunk