Browse Source

绘制地图优化

master
wanghongjun 3 days ago
parent
commit
020dbf2ff5
  1. 4
      app/Services/ParkingElectronicMapService.php

4
app/Services/ParkingElectronicMapService.php

@ -29,7 +29,7 @@ class ParkingElectronicMapService extends BaseService
'floor_id' => $floor_id,
'space_id' => $space_id
];
$res = ParkingElectronicMap::query()->where($where)->get()->toArray();
$res = ParkingElectronicMap::query()->where($where)->first();
$saveData['width'] = $data['width'] ?? '0';
$saveData['height'] = $data['height'] ?? '0';
$saveData['coordinate_x'] = $data['coordinate_x'] ?? '';
@ -40,7 +40,7 @@ class ParkingElectronicMapService extends BaseService
$saveData['aspect_ratio'] = $data['aspect_ratio'] ?? '';
if ($res) {
$saveData['update_at'] = get_datetime();
$model = ParkingElectronicMap::query()->findOrFail($res[0]['id']);
$model = ParkingElectronicMap::query()->findOrFail($res['id']);
$oldValues = $model->toArray();
$model->update($saveData);
$this->logService->logUpdated($model, $oldValues, 'map.save');

Loading…
Cancel
Save