Browse Source

相机管理限制优化

master
wanghongjun 1 month ago
parent
commit
3263b1ed61
  1. 20
      app/Services/ParkingCameraService.php

20
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) {

Loading…
Cancel
Save