Browse Source

车位资讯车牌优化3

master
wanghongjun 3 days ago
parent
commit
d23a60235f
  1. 8
      app/Services/ParkingInformationService.php

8
app/Services/ParkingInformationService.php

@ -33,14 +33,14 @@ class ParkingInformationService extends BaseService
DB::beginTransaction();
$license_plate = $data['license_plate'];
$license_plate = ParkingLicensePlate::query()->where(
$license_plate_data = ParkingLicensePlate::query()->where(
'number',
$license_plate
)->first(['id', 'space_type_id']);
$license_plate_id = 0;
if ($license_plate) {
$license_plate_id = $license_plate['id'];
$space_type_id = $license_plate['space_type_id'];
if ($license_plate_data) {
$license_plate_id = $license_plate_data['id'];
$space_type_id = $license_plate_data['space_type_id'];
} else {
$space_type_data = ParkingSpaceType::getDefaultData();
$space_type_id = $space_type_data['id'] ?? 0;

Loading…
Cancel
Save