Refactoring Simbrief fares and aircraft (#1054)

* Refactoring simbrief fares and aircraft

* Hide user full name/email

* Sort PIREP fields desc; fix cargo counts

* Change the sorting

* Extra logs

* Fix tests

* Return fare information through the API

* Style fixes

* Test fix

* Another test fix

* More fixes

* Set aircraft and fares in prefile

* Formatting
This commit is contained in:
Nabeel S
2021-03-02 12:29:04 -05:00
committed by GitHub
parent efcb7e8895
commit e22d6d5996
18 changed files with 986 additions and 761 deletions

View File

@@ -305,7 +305,9 @@ class Pirep extends Model
public function getFieldsAttribute()
{
$custom_fields = PirepField::all();
$field_values = PirepFieldValue::where('pirep_id', $this->id)->get();
$field_values = PirepFieldValue::where('pirep_id', $this->id)
->orderBy('created_at', 'asc')
->get();
// Merge the field values into $fields
foreach ($custom_fields as $field) {
@@ -321,7 +323,7 @@ class Pirep extends Model
}
}
return $field_values->sortBy('source');
return $field_values;
}
/**