Migration Fix
This commit is contained in:
@@ -24,9 +24,17 @@ class LogoController extends Controller
|
|||||||
public function getLogoByIATACode(string $code)
|
public function getLogoByIATACode(string $code)
|
||||||
{
|
{
|
||||||
$airline = Airline::where('IATA_code', strtoupper($code))
|
$airline = Airline::where('IATA_code', strtoupper($code))
|
||||||
->whereNotNull('logo')
|
->whereNotNull('logo')
|
||||||
->latest('id')
|
->where('active', true)
|
||||||
->first();
|
->latest('id')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (!$airline) {
|
||||||
|
$airline = Airline::where('IATA_code', strtoupper($code))
|
||||||
|
->whereNotNull('logo')
|
||||||
|
->latest('id')
|
||||||
|
->first();
|
||||||
|
}
|
||||||
|
|
||||||
return $this->getAirlineLogo($airline);
|
return $this->getAirlineLogo($airline);
|
||||||
}
|
}
|
||||||
@@ -34,9 +42,17 @@ class LogoController extends Controller
|
|||||||
public function getLogoByICAOCode(string $code)
|
public function getLogoByICAOCode(string $code)
|
||||||
{
|
{
|
||||||
$airline = Airline::where('ICAO_code', strtoupper($code))
|
$airline = Airline::where('ICAO_code', strtoupper($code))
|
||||||
->whereNotNull('logo')
|
->whereNotNull('logo')
|
||||||
->latest('id')
|
->where('active', true)
|
||||||
->first();
|
->latest('id')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (!$airline) {
|
||||||
|
$airline = Airline::where('ICAO_code', strtoupper($code))
|
||||||
|
->whereNotNull('logo')
|
||||||
|
->latest('id')
|
||||||
|
->first();
|
||||||
|
}
|
||||||
|
|
||||||
return $this->getAirlineLogo($airline);
|
return $this->getAirlineLogo($airline);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user