This commit is contained in:
Ludovic CANDELLIER
2021-08-21 19:48:21 +02:00
parent 7ec40145de
commit 9ca510086b
24 changed files with 423 additions and 65 deletions

View File

@@ -8,7 +8,7 @@ class Tariffs
{
public static function autocomplete($str)
{
$data = Tariff::where('name', 'LIKE', "%${str}%")->orderBy('name')->limit(30)->get()->pluck('name', 'id');
$data = Tariff::where('name', 'LIKE', "%${str}%")->orWhere('ref', 'LIKE', "${str}%")->orWhere('code', 'LIKE', "${str}%")->orderBy('name')->limit(30)->get()->pluck('name', 'id');
$export = [];
foreach ($data as $key => $name) {
$export[] = ['value' => $key, 'text' => $name];