From 3263b1ed6101fac0ad3d26bd104b65ad822f1d4f Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Thu, 7 May 2026 10:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B8=E6=9C=BA=E7=AE=A1=E7=90=86=E9=99=90?= =?UTF-8?q?=E5=88=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/ParkingCameraService.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/Services/ParkingCameraService.php b/app/Services/ParkingCameraService.php index e923a88..f53981a 100644 --- a/app/Services/ParkingCameraService.php +++ b/app/Services/ParkingCameraService.php @@ -119,15 +119,17 @@ class ParkingCameraService extends BaseService foreach ($data as &$item) { $control_lights_ip = $item['control_lights_ip'] ?? ''; $space_attr_id = $item['space_attr_id'] ?? ''; - if (empty($control_lights_ip)) { - throw new CustomException( - __('validation.parking_camera.lights_ip_empty') - ); - } - if (strlen($control_lights_ip) > 15) { - throw new CustomException( - __('validation.parking_camera.lights_ip_max') - ); + if ($data['is_control_lights'] == 1) { + if (empty($control_lights_ip)) { + throw new CustomException( + __('validation.parking_camera.lights_ip_empty') + ); + } + if (strlen($control_lights_ip) > 15) { + throw new CustomException( + __('validation.parking_camera.lights_ip_max') + ); + } } $space_id = ParkingSpace::getValueId($item['space_number']); if (!$space_id && $space_attr_id) {