diff --git a/app/Models/ParkingSpaceAttributes.php b/app/Models/ParkingSpaceAttributes.php index 22bca01..ebfb811 100644 --- a/app/Models/ParkingSpaceAttributes.php +++ b/app/Models/ParkingSpaceAttributes.php @@ -41,7 +41,7 @@ class ParkingSpaceAttributes extends Model $model->where('is_default', 0); } $data = $model->get()->select( - ['id', 'attributes'] + ['id', 'attributes', 'import_diagram'] )->toArray(); foreach ($data as $key => $item) { $data[$key]['attributes'] @@ -50,6 +50,11 @@ class ParkingSpaceAttributes extends Model 2, $item['attributes'] ); + if ($is_default == 1) { + unset($item['import_diagram']); + } else { + $item['import_diagram_url'] = get_image_url($item['import_diagram']); + } } return $data; }