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

@@ -3,6 +3,7 @@
namespace App\Repositories;
use App\Models\Acars;
use App\Models\Enums\AcarsType;
use App\Models\Pirep;
use App\Models\Enums\PirepState;
@@ -27,7 +28,12 @@ class AcarsRepository extends BaseRepository //implements CacheableInterface
'type' => $type,
];
return $this->orderBy('created_at', 'asc')->findWhere($where);
$order_by = 'created_at';
if($type === AcarsType::ROUTE) {
$order_by = 'order';
}
return $this->orderBy('order', 'asc')->findWhere($where);
}
/**