From 71fafc13569ef0dcb6ba945e276705a9683777fa Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Mon, 7 Sep 2026 14:15:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E4=BD=8D=E5=9C=B0=E5=9B=BE=20?= =?UTF-8?q?=E8=BD=A6=E4=BD=8D=E5=B1=9E=E6=80=A7=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/ParkingSpaceAttributes.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Models/ParkingSpaceAttributes.php b/app/Models/ParkingSpaceAttributes.php index a77cb59..22bca01 100644 --- a/app/Models/ParkingSpaceAttributes.php +++ b/app/Models/ParkingSpaceAttributes.php @@ -34,9 +34,13 @@ class ParkingSpaceAttributes extends Model )->toArray(); } - public static function getTypeList(): array + public static function getTypeList($is_default = 1): array { - $data = self::query()->where('is_default', 0)->get()->select( + $model = self::query(); + if ($is_default == 1) { + $model->where('is_default', 0); + } + $data = $model->get()->select( ['id', 'attributes'] )->toArray(); foreach ($data as $key => $item) {