From fd3bd4b7751e5cbfa530caf34678dec53805b06e Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Wed, 10 Jun 2026 17:41:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/AdminFloor.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Models/AdminFloor.php b/app/Models/AdminFloor.php index 9cadf89..06e999d 100644 --- a/app/Models/AdminFloor.php +++ b/app/Models/AdminFloor.php @@ -53,11 +53,13 @@ class AdminFloor extends Model public static function getFirst($id) { $item = self::query()->where(['status' => 1, 'id' => $id])->first(); - $item['name'] = AdminTranslationService::getTranslationTypeName( - $item['id'], - 4, - $item['name'] - ); + if ($item) { + $item['name'] = AdminTranslationService::getTranslationTypeName( + $item['id'], + 4, + $item['name'] + ); + } return $item; }