Fix generatore numerazione progressiva
This commit is contained in:
parent
4d03890ce9
commit
c4201b2cc3
|
@ -201,7 +201,11 @@ class Generator
|
||||||
$maschera = Generator::complete($maschera, [], $date);
|
$maschera = Generator::complete($maschera, [], $date);
|
||||||
$maschera = str_replace('#', '%', $maschera);
|
$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) {
|
foreach ($where as $and) {
|
||||||
$query->whereRaw($and);
|
$query->whereRaw($and);
|
||||||
|
|
Loading…
Reference in New Issue