Fix column headers
This commit is contained in:
@@ -318,6 +318,7 @@ flights:
|
||||
level: 360
|
||||
dpt_time: 6PM CST
|
||||
arr_time: 11PM EST
|
||||
flight_time: 240
|
||||
flight_type: J
|
||||
created_at: NOW
|
||||
updated_at: NOW
|
||||
@@ -329,6 +330,7 @@ flights:
|
||||
arr_airport_id: LGRP
|
||||
dpt_time: 9AM CST
|
||||
arr_time: 1030AM CST
|
||||
flight_time: 30
|
||||
flight_type: J
|
||||
route: PITZZ4 MNURE WLEEE4
|
||||
created_at: NOW
|
||||
@@ -340,6 +342,7 @@ flights:
|
||||
route_leg: 1
|
||||
dpt_airport_id: EGLL
|
||||
arr_airport_id: KJFK
|
||||
flight_time: 480
|
||||
flight_type: J
|
||||
dpt_time: 9AM CST
|
||||
arr_time: 1030AM CST
|
||||
|
||||
@@ -20,6 +20,9 @@ use PhpUnitsOfMeasure\Exception\NonStringUnitName;
|
||||
* @property Collection fares
|
||||
* @property Collection subfleets
|
||||
* @property integer days
|
||||
* @property Airport dep_airport
|
||||
* @property Airport arr_airport
|
||||
* @property Airport alt_airport
|
||||
* @property string dpt_airport_id
|
||||
* @property string arr_airport_id
|
||||
* @property string alt_airport_id
|
||||
|
||||
@@ -53,7 +53,7 @@ class ExportService extends Service
|
||||
$writer = $this->openCsv($path);
|
||||
|
||||
// Write out the header first
|
||||
$writer->insertOne(array_keys($exporter->getColumns()));
|
||||
$writer->insertOne($exporter->getColumns());
|
||||
|
||||
// Write the rest of the rows
|
||||
foreach ($collection as $row) {
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace App\Services\ImportExport;
|
||||
|
||||
use App\Interfaces\ImportExport;
|
||||
use App\Models\Enums\Days;
|
||||
use App\Models\Enums\FlightType;
|
||||
use App\Models\Flight;
|
||||
|
||||
/**
|
||||
@@ -47,7 +46,6 @@ class FlightExporter extends ImportExport
|
||||
}
|
||||
|
||||
$ret['days'] = $this->getDays($flight);
|
||||
#$ret['flight_type'] = FlightType::convertToCode($ret['flight_type']);
|
||||
|
||||
$ret['fares'] = $this->getFares($flight);
|
||||
$ret['fields'] = $this->getFields($flight);
|
||||
|
||||
@@ -301,6 +301,7 @@ class ImporterTest extends TestCase
|
||||
|
||||
$this->assertEquals('27', $exported['days']);
|
||||
$this->assertEquals('VMS', $exported['airline']);
|
||||
$this->assertEquals($flight->flight_time, $exported['flight_time']);
|
||||
$this->assertEquals('J', $exported['flight_type']);
|
||||
$this->assertEquals('A32X;B74X', $exported['subfleets']);
|
||||
$this->assertEquals('Y?capacity=100;F', $exported['fares']);
|
||||
|
||||
Reference in New Issue
Block a user