Set a default model value for airports on PIREP (#500)
* Set a default model value for airports on PIREP * Fix airport icao reference * Default airport models
This commit is contained in:
@@ -108,14 +108,6 @@ class FlightImporter extends ImportExport
|
||||
|
||||
// Any specific transformations
|
||||
|
||||
// Check/calculate the distance
|
||||
if (empty($row['distance'])) {
|
||||
$row['distance'] = $this->airportSvc->calculateDistance(
|
||||
$row['dpt_airport'],
|
||||
$row['arr_airport']
|
||||
);
|
||||
}
|
||||
|
||||
// Check for a valid value
|
||||
$flight_type = $row['flight_type'];
|
||||
if (!array_key_exists($flight_type, FlightType::labels())) {
|
||||
@@ -139,6 +131,14 @@ class FlightImporter extends ImportExport
|
||||
$this->processAirport($row['alt_airport']);
|
||||
}
|
||||
|
||||
// Check/calculate the distance
|
||||
if (empty($row['distance'])) {
|
||||
$row['distance'] = $this->airportSvc->calculateDistance(
|
||||
$row['dpt_airport'],
|
||||
$row['arr_airport']
|
||||
);
|
||||
}
|
||||
|
||||
$this->processSubfleets($flight, $row['subfleets']);
|
||||
$this->processFares($flight, $row['fares']);
|
||||
$this->processFields($flight, $row['fields']);
|
||||
|
||||
Reference in New Issue
Block a user