Added Notifications
This commit is contained in:
@@ -16,13 +16,13 @@ class SearchController extends Controller
|
||||
->where(function ($query) use ($q) {
|
||||
$len = strlen($q);
|
||||
if ($len === 2) {
|
||||
$query->where('IATA_code', 'ilike', $q);
|
||||
$query->where('iata_code', 'ilike', $q);
|
||||
} elseif ($len === 3) {
|
||||
$query->where('ICAO_code', 'ilike', $q);
|
||||
$query->where('icao_code', 'ilike', $q);
|
||||
} else {
|
||||
$query->where('name', 'ilike', "%{$q}%")
|
||||
->orWhere('IATA_code', 'ilike', "%{$q}%")
|
||||
->orWhere('ICAO_code', 'ilike', "%{$q}%");
|
||||
->orWhere('iata_code', 'ilike', "%{$q}%")
|
||||
->orWhere('icao_code', 'ilike', "%{$q}%");
|
||||
}
|
||||
})
|
||||
->limit(50)
|
||||
@@ -44,7 +44,7 @@ class SearchController extends Controller
|
||||
->orWhereRaw("CONCAT(manufacturer_code, ' ', model_full_name) ilike ?", ["%{$q}%"])
|
||||
->orWhereRaw("CONCAT(manufacturer_code, ' ', model_full_name) ilike ?", ["%{$replacedQuery}%"])
|
||||
->limit(200)
|
||||
->orderBy('id', 'asc')
|
||||
->orderBy('preferred', 'desc')
|
||||
->get(['id', 'manufacturer_code', 'model_full_name', 'designator'])
|
||||
->map(fn($aircraft) => [
|
||||
'value' => $aircraft->id,
|
||||
|
||||
Reference in New Issue
Block a user