!160 Fix the front-end error reporting problem when the page is deleted

* wip
* Fix the front-end error reporting problem when the page is deleted
This commit is contained in:
pushuo 2023-07-20 01:43:20 +00:00 committed by Edward Yang
parent a3d35f6f09
commit 2b12969d3a
1 changed files with 1 additions and 2 deletions

View File

@ -65,8 +65,7 @@ class Url
return $value->url ?? '';
} elseif ($type == 'page') {
if (! $value instanceof \Beike\Models\Page) {
$page = \Beike\Models\Page::query()->find($value);
$value = $page->active ? $page : null;
$value = \Beike\Models\Page::query()->where('active', 1)->find($value);
}
return $value->url ?? '';