thinkphp5.0ページングコールバック処理eachメソッドにエラーがあります
TP 5,eachメソッドコードthinkphp/library/think/Collection.php (each)
foreach内は$this値に影響しません.
コードの変更:
質問があればグループ162092974に問い合わせてください.
/**
*
*
* @param callable $callback
* @return $this
*/
public function each(callable $callback)
{
foreach ($this->items as $key => $item) {
if ($callback($item, $key) === false) {
break;
}
}
return $this;
}
foreach内は$this値に影響しません.
コードの変更:
public function each(callable $callback)
{
foreach ($this->items as $key => $item) {
$this->items[$key] = $callback($item, $key);
if ($callback($item, $key) === false) {
break;
}
}
return $this;
}
質問があればグループ162092974に問い合わせてください.