Fix minore

This commit is contained in:
Pek5892 2024-02-16 10:10:17 +01:00
parent b2b39cbff4
commit 5d11a63c18
1 changed files with 2 additions and 2 deletions

View File

@ -89,10 +89,10 @@ class Anagrafica extends Model
public static function fromTipo($type)
{
$tipologia = TipoAnagrafica::where('name', $type)->first();
$tipologia = (new TipoAnagrafica())->getByName($type)->id_record;
$anagrafiche = self::whereHas('tipi', function ($query) use ($tipologia) {
$query->where('`an_tipianagrafiche`.`id`', '=', $tipologia->id);
$query->where('an_tipianagrafiche.id', '=', $tipologia->id);
});
return $anagrafiche;