Add flight_time to searchable fields (#1356)

This commit is contained in:
B.Fatih KOZ 2021-11-18 23:05:04 +03:00 committed by GitHub
parent 4ea8357952
commit 66d83c0ce6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@ class FlightRepository extends Repository implements CacheableInterface
'callsign',
'distance',
'dpt_airport_id',
'flight_time',
'flight_type',
'flight_number' => 'like',
'route_code' => 'like',
@ -133,6 +134,16 @@ class FlightRepository extends Repository implements CacheableInterface
$where[] = ['distance', '<=', $request->input('dlt')];
}
// Time, greater than
if ($request->filled('tgt')) {
$where[] = ['flight_time', '>=', $request->input('tgt')];
}
// Time, less than
if ($request->filled('tlt')) {
$where[] = ['flight_time', '<=', $request->input('tlt')];
}
// Do a special query for finding the child subfleets
if ($request->filled('subfleet_id')) {
$relations['subfleets'] = [