Fix ricerca iscritto newsletter (PHP 8.0)

This commit is contained in:
loviuz 2022-07-30 16:03:32 +02:00
parent 36fbde507b
commit 58c70f98d4
1 changed files with 3 additions and 3 deletions

View File

@ -33,15 +33,15 @@ if (!empty($search)) {
$destinatari = $riferimento->destinatari() $destinatari = $riferimento->destinatari()
->where(function ($query) use ($results) { ->where(function ($query) use ($results) {
$query->where('record_type', '=', Anagrafica::class) $query->where('record_type', '=', Anagrafica::class)
->whereIn('record_id', $results['anagrafica']); ->whereIn('record_id', (!empty($results['anagrafica']) ? $results['anagrafica']->toArray() : []));
}) })
->orWhere(function ($query) use ($results) { ->orWhere(function ($query) use ($results) {
$query->where('record_type', '=', Sede::class) $query->where('record_type', '=', Sede::class)
->whereIn('record_id', $results['sede']); ->whereIn('record_id', (!empty($results['sede']) ? $results['sede']->toArray() : []));
}) })
->orWhere(function ($query) use ($results) { ->orWhere(function ($query) use ($results) {
$query->where('record_type', '=', Referente::class) $query->where('record_type', '=', Referente::class)
->whereIn('record_id', $results['referente']); ->whereIn('record_id', (!empty($results['referente']) ? $results['referente']->toArray() : []));
}); });
} }
// Elenco di tutti i destinatari // Elenco di tutti i destinatari