Add flight_time to searchable fields (#1356)

snyk-fix-ed3fe04db6197250a60896a7e08113f6
B.Fatih KOZ 3 years ago committed by GitHub
parent 4ea8357952
commit 66d83c0ce6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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'] = [

Loading…
Cancel
Save