1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-28 22:49:38 +01:00

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

View File

@ -33,15 +33,15 @@ if (!empty($search)) {
$destinatari = $riferimento->destinatari()
->where(function ($query) use ($results) {
$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) {
$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) {
$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