改名
This commit is contained in:
@@ -188,20 +188,12 @@ class ActiveQuery extends Component
|
|||||||
*/
|
*/
|
||||||
public function plunk(int $size, callable $callback, $param = null, $offset = 0, $total = -1)
|
public function plunk(int $size, callable $callback, $param = null, $offset = 0, $total = -1)
|
||||||
{
|
{
|
||||||
if (!is_callable($callback, true)) {
|
$pagination = new Pagination($this);
|
||||||
return;
|
$pagination->setOffset($offset);
|
||||||
}
|
$pagination->setLimit($size);
|
||||||
$data = $this->limit($offset, $size)->get();
|
$pagination->setMax($total);
|
||||||
if ($param !== null) {
|
$pagination->setCallback($callback);
|
||||||
call_user_func($callback, $data, $param);
|
$pagination->search($param);
|
||||||
} else {
|
|
||||||
call_user_func($callback, $data);
|
|
||||||
}
|
|
||||||
if ($data->size() < $size) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
unset($data);
|
|
||||||
$this->plunk($size, $callback, $param, $offset + $size, $total);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user