diff --git a/app/Repositories/FlightRepository.php b/app/Repositories/FlightRepository.php index 4faa4ad5..99136a7a 100644 --- a/app/Repositories/FlightRepository.php +++ b/app/Repositories/FlightRepository.php @@ -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'] = [