From 1a9b29ccfbcd6ba40f22786d1a05e4729cf4c779 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Tue, 16 Jun 2026 17:00:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E4=BD=8D=E5=B1=9E=E6=80=A7=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/ParkingSpaceAttributes.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Models/ParkingSpaceAttributes.php b/app/Models/ParkingSpaceAttributes.php index 64b229b..9c29430 100644 --- a/app/Models/ParkingSpaceAttributes.php +++ b/app/Models/ParkingSpaceAttributes.php @@ -36,9 +36,10 @@ class ParkingSpaceAttributes extends Model public static function getTypeList(): array { - return self::query()->where('is_default', 0)->get()->select( + $data = self::query()->where('is_default', 0)->get()->select( ['id', 'attributes'] - )->each(function ($item) { + )->toArray(); + foreach ($data as &$item) { $item['attributes'] = AdminTranslationService::getTranslationTypeName( $item['id'], @@ -46,7 +47,8 @@ class ParkingSpaceAttributes extends Model $item['attributes'] ); return $item; - })->toArray(); + } + return $data; } public static function getAttr($id)