From 2b12969d3a3ff740c05601e144ea21f515a6257c Mon Sep 17 00:00:00 2001 From: pushuo Date: Thu, 20 Jul 2023 01:43:20 +0000 Subject: [PATCH] !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 --- beike/Libraries/Url.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/beike/Libraries/Url.php b/beike/Libraries/Url.php index a404641a..22c8e4db 100644 --- a/beike/Libraries/Url.php +++ b/beike/Libraries/Url.php @@ -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 ?? '';