修复分页回调each问题

This commit is contained in:
2026-08-13 10:14:14 +08:00
parent b1f99153b2
commit 9e3c82086c

View File

@@ -142,7 +142,7 @@ abstract class Model extends HyperfModel implements CacheableInterface
$size = max(1, min(100, $size));
$result = $query->paginate($size, ['*'], 'page', $page);
if (is_callable($eachCallback) && method_exists($result, 'each')) {
if (is_callable($eachCallback)) {
$result->each($eachCallback);
}
return [