Compare commits
2 Commits
b4e2caad07
...
9631e7949d
| Author | SHA1 | Date | |
|---|---|---|---|
| 9631e7949d | |||
| d0fe6d78d3 |
@@ -83,7 +83,7 @@ class FlightImportController extends Controller
|
||||
->get(['id', 'name', 'municipality', 'iata_code', 'icao_code', 'region_id'])
|
||||
->map(fn($a) => [
|
||||
'value' => $a->id,
|
||||
'title' => "{$a->name} ({$a->iata_code}/{$a->icao_code})",
|
||||
'title' => "{$a->municipality} / {$a->name} ({$a->iata_code}/{$a->icao_code})",
|
||||
'country_code' => strtolower($a?->region->country->code ?? ''),
|
||||
])
|
||||
->values()
|
||||
@@ -129,7 +129,7 @@ class FlightImportController extends Controller
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
$flightToReconcile = ImportedFlight::where('user_id', $user->id)->orderBy('id')->first();
|
||||
$flightToReconcile = ImportedFlight::where('user_id', $user->id)->orderBy('date', 'asc')->first();
|
||||
|
||||
if (!$flightToReconcile) {
|
||||
return null;
|
||||
|
||||
@@ -66,7 +66,7 @@ class SearchController extends Controller
|
||||
->get(['id', 'name', 'municipality', 'iata_code', 'icao_code', 'region_id'])
|
||||
->map(fn($a) => [
|
||||
'value' => $a->id,
|
||||
'title' => "{$a->name} ({$a->iata_code}/{$a->icao_code})",
|
||||
'title' => "{$a->municipality} / {$a->name} ({$a->iata_code}/{$a->icao_code})",
|
||||
'country_code' => strtolower($a->region->country->code),
|
||||
])
|
||||
->values();
|
||||
|
||||
@@ -14,8 +14,7 @@ class Airline extends Model
|
||||
'ICAO_code',
|
||||
'name',
|
||||
'internal_name',
|
||||
'country_code',
|
||||
'country_name',
|
||||
'country_id',
|
||||
'active',
|
||||
'logo',
|
||||
];
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
DB::table('airlines')
|
||||
->where('internal_name', 'gol-airlines')
|
||||
->update([
|
||||
'ICAO_code' => 'GLO',
|
||||
'active' => true,
|
||||
]);
|
||||
|
||||
DB::table('airlines')
|
||||
->where('internal_name', 'jetgo')
|
||||
->update([
|
||||
'logo' => 'JG_1.png',
|
||||
'active' => false,
|
||||
]);
|
||||
|
||||
DB::table('airlines')
|
||||
->where('internal_name', 'turpial')
|
||||
->update([
|
||||
'logo' => 'T9.png',
|
||||
'IATA_code' => 'T9',
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
DB::table('airlines')
|
||||
->where('internal_name', 'gol-airlines')
|
||||
->update([
|
||||
'ICAO_code' => '',
|
||||
'active' => false,
|
||||
]);
|
||||
|
||||
DB::table('airlines')
|
||||
->where('internal_name', 'jetgo')
|
||||
->update([
|
||||
'logo' => 'JG.png',
|
||||
'active' => true,
|
||||
]);
|
||||
|
||||
DB::table('airlines')
|
||||
->where('internal_name', 'turpial')
|
||||
->update([
|
||||
'logo' => '',
|
||||
'IATA_code' => '',
|
||||
]);
|
||||
}
|
||||
};
|
||||
@@ -34,6 +34,10 @@ Route::domain(config('app.domain'))->group(
|
||||
Route::get('/reconcile', function () {
|
||||
$flight = new FlightImportController()->reconcile(request());
|
||||
|
||||
if (!$flight) {
|
||||
return to_route('import.fr24');
|
||||
}
|
||||
|
||||
return Inertia::render('ReconcileFlight', [
|
||||
'flight' => $flight,
|
||||
'key' => $flight['imported_flight_id'],
|
||||
|
||||
Reference in New Issue
Block a user