specify fares, js to dynamically change fare form; get applicable fares for the flight/pirep #125

This commit is contained in:
Nabeel Shahzad
2018-02-24 15:38:25 -06:00
parent 910c0e0eab
commit 58e0f50c48
28 changed files with 1063 additions and 265 deletions

View File

@@ -16,6 +16,8 @@ class FlightRepository extends BaseRepository implements CacheableInterface
'arr_airport_id',
'dpt_airport_id',
'flight_number' => 'like',
'flight_code' => 'like',
'flight_leg' => 'like',
'route' => 'like',
'notes' => 'like',
];
@@ -25,6 +27,33 @@ class FlightRepository extends BaseRepository implements CacheableInterface
return Flight::class;
}
/**
* Find a flight based on the given criterea
* @param $airline_id
* @param $flight_num
* @param null $flight_code
* @param null $flight_leg
* @return mixed
*/
public function findFlight($airline_id, $flight_num, $flight_code=null, $flight_leg=null)
{
$where = [
'airline_id' => $airline_id,
'flight_num' => $flight_num,
'active' => true,
];
if(filled($flight_code)) {
$where['flight_code'] = $flight_code;
}
if(filled('flight_leg')) {
$where['flight_leg'] = $flight_leg;
}
return $this->findWhere($where);
}
/**
* Create the search criteria and return this with the stuff pushed
* @param Request $request