Add order column to ACARS table for the order of the route points

This commit is contained in:
Nabeel Shahzad
2018-01-02 09:40:42 -06:00
parent 7a6395be27
commit 37cdde845d
5 changed files with 19 additions and 5 deletions

View File

@@ -36,10 +36,12 @@ class PIREPTest extends TestCase
protected function getAcarsRoute($pirep)
{
$pirep->refresh();
$saved_route = [];
$route_points = Acars::where(
['pirep_id' => $pirep->id, 'type' => AcarsType::ROUTE]
)->orderBy('created_at', 'asc')->get();
)->orderBy('order', 'asc')->get();
foreach ($route_points as $point) {
$saved_route[] = $point->name;