++ gruppi: chi fa parte di un gruppo di servizio e' segnalato
Badge "Gruppo ..." / "Sorvegliante del gruppo ..." nell'elenco dei proclamatori (con il filtro "In un gruppo di servizio") e in testa alla scheda; nella scelta del proclamatore (Assegna, Registro) la nota "gruppo ..." accanto al nome, che resta sceglibile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -106,7 +106,7 @@ class ProclamatoreIndex extends Component
|
||||
// withCount rather than letting the view call
|
||||
// ->assegnazioni()->aperte()->count() per row, which issued one
|
||||
// COUNT(*) per displayed proclamatore on every render.
|
||||
$query = Proclamatore::query()->withCount([
|
||||
$query = Proclamatore::query()->with('gruppo')->withCount([
|
||||
'assegnazioni as assegnazioni_aperte_count' => fn ($q) => $q->whereNull('returned_at'),
|
||||
]);
|
||||
|
||||
@@ -124,6 +124,8 @@ class ProclamatoreIndex extends Component
|
||||
$filtered = $filtered->where('attivo', true);
|
||||
} elseif ($this->filtroStato === 'inattivo') {
|
||||
$filtered = $filtered->where('attivo', false);
|
||||
} elseif ($this->filtroStato === 'gruppo') {
|
||||
$filtered = $filtered->whereNotNull('gruppo_servizio_id');
|
||||
}
|
||||
|
||||
// Sort in-memory
|
||||
@@ -148,6 +150,8 @@ class ProclamatoreIndex extends Component
|
||||
$query->where('attivo', true);
|
||||
} elseif ($this->filtroStato === 'inattivo') {
|
||||
$query->where('attivo', false);
|
||||
} elseif ($this->filtroStato === 'gruppo') {
|
||||
$query->whereNotNull('gruppo_servizio_id');
|
||||
}
|
||||
|
||||
// cognome/nome encrypted, so sort in-memory
|
||||
|
||||
Reference in New Issue
Block a user