flights filtered per va
This commit is contained in:
@@ -52,7 +52,8 @@ class FlightController extends Controller
|
|||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$where = [
|
$where = [
|
||||||
'active' => true
|
'active' => true,
|
||||||
|
'airline_id' => Auth::user()->airline_id,
|
||||||
];
|
];
|
||||||
|
|
||||||
// default restrictions on the flights shown. Handle search differently
|
// default restrictions on the flights shown. Handle search differently
|
||||||
@@ -68,6 +69,8 @@ class FlightController extends Controller
|
|||||||
|
|
||||||
$flights = $this->flightRepo
|
$flights = $this->flightRepo
|
||||||
->orderBy('flight_number', 'asc')
|
->orderBy('flight_number', 'asc')
|
||||||
|
->orderBy('route_leg', 'asc')
|
||||||
|
->orderBy('route_code', 'asc')
|
||||||
->paginate();
|
->paginate();
|
||||||
|
|
||||||
$saved_flights = Bid::where('user_id', Auth::id())
|
$saved_flights = Bid::where('user_id', Auth::id())
|
||||||
@@ -94,7 +97,7 @@ class FlightController extends Controller
|
|||||||
$saved_flights = $flights->pluck('id')->toArray();
|
$saved_flights = $flights->pluck('id')->toArray();
|
||||||
|
|
||||||
return view('flights.index', [
|
return view('flights.index', [
|
||||||
'title' => 'Bids',
|
'title' => trans_choice('frontend.flights.mybid', 2),
|
||||||
'airlines' => $this->airlineRepo->selectBoxList(true),
|
'airlines' => $this->airlineRepo->selectBoxList(true),
|
||||||
'airports' => $this->airportRepo->selectBoxList(true),
|
'airports' => $this->airportRepo->selectBoxList(true),
|
||||||
'flights' => $flights,
|
'flights' => $flights,
|
||||||
@@ -110,7 +113,13 @@ class FlightController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function search(Request $request)
|
public function search(Request $request)
|
||||||
{
|
{
|
||||||
$flights = $this->flightRepo->searchCriteria($request)->paginate();
|
$request['airline_id'] = Auth::user()->airline_id;
|
||||||
|
|
||||||
|
$flights = $this->flightRepo->searchCriteria($request)
|
||||||
|
->orderBy('flight_number', 'asc')
|
||||||
|
->orderBy('route_leg', 'asc')
|
||||||
|
->orderBy('route_code', 'asc')
|
||||||
|
->paginate();
|
||||||
|
|
||||||
$saved_flights = Bid::where('user_id', Auth::id())
|
$saved_flights = Bid::where('user_id', Auth::id())
|
||||||
->pluck('flight_id')->toArray();
|
->pluck('flight_id')->toArray();
|
||||||
|
|||||||
Reference in New Issue
Block a user