Make sure proper fares are returned from the API #899
This commit is contained in:
@@ -45,6 +45,7 @@ class BidService extends Service
|
||||
{
|
||||
$bids = Bid::with([
|
||||
'flight',
|
||||
'flight.fares',
|
||||
'flight.simbrief',
|
||||
'flight.subfleets',
|
||||
'flight.subfleets.aircraft',
|
||||
|
||||
@@ -60,13 +60,13 @@ class FareService extends Service
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fares
|
||||
* Get a fare with the proper prices/costs populated in the pivot
|
||||
*
|
||||
* @param $fare
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getFares($fare)
|
||||
public function getFares($fare)
|
||||
{
|
||||
$pivot = $fare->pivot;
|
||||
if (filled($pivot->price)) {
|
||||
|
||||
@@ -16,6 +16,7 @@ use App\Support\Units\Time;
|
||||
class FlightService extends Service
|
||||
{
|
||||
private $airportSvc;
|
||||
private $fareSvc;
|
||||
private $flightRepo;
|
||||
private $navDataRepo;
|
||||
private $userSvc;
|
||||
@@ -24,17 +25,20 @@ class FlightService extends Service
|
||||
* FlightService constructor.
|
||||
*
|
||||
* @param AirportService $airportSvc
|
||||
* @param FareService $fareSvc
|
||||
* @param FlightRepository $flightRepo
|
||||
* @param NavdataRepository $navdataRepo
|
||||
* @param UserService $userSvc
|
||||
*/
|
||||
public function __construct(
|
||||
AirportService $airportSvc,
|
||||
FareService $fareSvc,
|
||||
FlightRepository $flightRepo,
|
||||
NavdataRepository $navdataRepo,
|
||||
UserService $userSvc
|
||||
) {
|
||||
$this->airportSvc = $airportSvc;
|
||||
$this->fareSvc = $fareSvc;
|
||||
$this->flightRepo = $flightRepo;
|
||||
$this->navDataRepo = $navdataRepo;
|
||||
$this->userSvc = $userSvc;
|
||||
|
||||
Reference in New Issue
Block a user