Skip to content

Commit

Permalink
改进
Browse files Browse the repository at this point in the history
  • Loading branch information
yunwuxin committed Oct 26, 2022
1 parent 2e2c690 commit a0f21a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/resetters/ResetModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class ResetModel implements ResetterInterface
public function handle(App $app, Sandbox $sandbox)
{
if (class_exists(Model::class)) {
Model::setInvoker(function (...$args) use ($app) {
return $app->invoke(...$args);
Model::setInvoker(function (...$args) use ($sandbox) {
return $sandbox->getApplication()->invoke(...$args);
});
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/resetters/ResetPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ class ResetPaginator implements ResetterInterface

public function handle(App $app, Sandbox $sandbox)
{
Paginator::currentPathResolver(function () use ($app) {
return $app->request->baseUrl();
Paginator::currentPathResolver(function () use ($sandbox) {
return $sandbox->getApplication()->request->baseUrl();
});

Paginator::currentPageResolver(function ($varPage = 'page') use ($app) {
Paginator::currentPageResolver(function ($varPage = 'page') use ($sandbox) {

$page = $app->request->param($varPage);
$page = $sandbox->getApplication()->request->param($varPage);

if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) {
return (int) $page;
Expand Down

0 comments on commit a0f21a2

Please sign in to comment.