Match Flight and Pirep ident attributes (#1342)

* Flight ident change

* Pirep ident change

* Update Pirep.php
This commit is contained in:
B.Fatih KOZ 2021-11-02 16:23:52 +03:00 committed by GitHub
parent 9956929df7
commit 571768b39d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 10 deletions

View File

@ -136,7 +136,7 @@ class Flight extends Model
}
/**
* Get the flight ident, e.,g JBU1900
* Get the flight ident, e.,g JBU1900/C.nn/L.yy
*/
public function getIdentAttribute(): string
{
@ -144,11 +144,11 @@ class Flight extends Model
$flight_id .= $this->flight_number;
if (filled($this->route_code)) {
$flight_id .= '-'.$this->route_code;
$flight_id .= '/C.'.$this->route_code;
}
if (filled($this->route_leg)) {
$flight_id .= '-'.$this->route_leg;
$flight_id .= '/L.'.$this->route_leg;
}
return $flight_id;

View File

@ -215,21 +215,19 @@ class Pirep extends Model
}
/**
* Get the flight ident, e.,g JBU1900
*
* @return string
* Get the flight ident, e.,g JBU1900/C.nn/L.yy
*/
public function getIdentAttribute(): string
{
//$flight_id = $this->airline->code;
$flight_id = $this->flight_number;
$flight_id = $this->airline->code;
$flight_id .= $this->flight_number;
if (filled($this->route_code)) {
$flight_id .= '/C'.$this->route_code;
$flight_id .= '/C.'.$this->route_code;
}
if (filled($this->route_leg)) {
$flight_id .= '/L'.$this->route_leg;
$flight_id .= '/L.'.$this->route_leg;
}
return $flight_id;