This commit is contained in:
MatteoPistorello 2022-09-01 12:52:37 +02:00
commit eb1d5b03fb
1 changed files with 5 additions and 1 deletions

View File

@ -201,7 +201,11 @@ class Generator
$maschera = Generator::complete($maschera, [], $date);
$maschera = str_replace('#', '%', $maschera);
$query = Manager::table($table)->select($field)->where($field, 'like', $maschera)->orderByRaw($order);
//Lunghezza maschera
$mask_length = strlen($maschera);
$query = Manager::table($table)->select($field)->where($field, 'like', $maschera)->whereRaw('LENGTH( numero_esterno )<='.$mask_length)->orderByRaw('LENGTH(numero_esterno) DESC')->orderByRaw($order);
foreach ($where as $and) {
$query->whereRaw($and);