feat(catasto): estensione ricerca nominativi e bottone cima TAB B per integrazione Torre
This commit is contained in:
parent
c77fcae9a0
commit
4705a2d0f3
|
|
@ -326,12 +326,28 @@ public function loadUnitaList(): void
|
||||||
->orderBy('interno');
|
->orderBy('interno');
|
||||||
|
|
||||||
if (trim($this->search) !== '') {
|
if (trim($this->search) !== '') {
|
||||||
$query->where(function($q) {
|
$searchTerm = '%' . trim($this->search) . '%';
|
||||||
$q->where('interno', 'like', '%' . $this->search . '%')
|
$query->where(function($q) use ($searchTerm) {
|
||||||
->orWhere('scala', 'like', '%' . $this->search . '%')
|
$q->where('interno', 'like', $searchTerm)
|
||||||
->orWhere('piano', 'like', '%' . $this->search . '%');
|
->orWhere('scala', 'like', $searchTerm)
|
||||||
|
->orWhere('piano', 'like', $searchTerm);
|
||||||
if (Schema::hasColumn('unita_immobiliari', 'subalterno')) {
|
if (Schema::hasColumn('unita_immobiliari', 'subalterno')) {
|
||||||
$q->orWhere('subalterno', 'like', '%' . $this->search . '%');
|
$q->orWhere('subalterno', 'like', $searchTerm);
|
||||||
|
}
|
||||||
|
if (Schema::hasTable('unita_immobiliare_nominativi')) {
|
||||||
|
$q->orWhereIn('id', function($subQuery) use ($searchTerm) {
|
||||||
|
$subQuery->select('unita_immobiliare_id')
|
||||||
|
->from('unita_immobiliare_nominativi')
|
||||||
|
->where('nominativo', 'like', $searchTerm);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (Schema::hasTable('anagrafiche') && Schema::hasTable('unita_anagrafica_periodo')) {
|
||||||
|
$q->orWhereIn('id', function($subQuery) use ($searchTerm) {
|
||||||
|
$subQuery->select('uap.unita_immobiliare_id')
|
||||||
|
->from('unita_anagrafica_periodo as uap')
|
||||||
|
->join('anagrafiche as a', 'a.id', '=', 'uap.anagrafica_id')
|
||||||
|
->where(DB::raw("COALESCE(a.cognome, '') || ' ' || COALESCE(a.nome, '')"), 'like', $searchTerm);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -398,9 +398,14 @@ class="bg-emerald-600 hover:bg-emerald-700 text-white font-bold px-1.5 py-0.5 ro
|
||||||
<div class="hub-spalla-sinistra col-span-12 lg:col-span-4 bg-white dark:bg-gray-900 rounded-xl p-4 shadow-sm space-y-4 border border-gray-200 dark:border-gray-800">
|
<div class="hub-spalla-sinistra col-span-12 lg:col-span-4 bg-white dark:bg-gray-900 rounded-xl p-4 shadow-sm space-y-4 border border-gray-200 dark:border-gray-800">
|
||||||
<div class="flex items-center justify-between border-b pb-2">
|
<div class="flex items-center justify-between border-b pb-2">
|
||||||
<h3 class="text-xs font-bold text-gray-900 dark:text-white uppercase tracking-wider">Unità Stabile</h3>
|
<h3 class="text-xs font-bold text-gray-900 dark:text-white uppercase tracking-wider">Unità Stabile</h3>
|
||||||
<button type="button" wire:click="toggleSort" class="text-xxs font-semibold text-primary-600 hover:underline">
|
<div class="flex items-center gap-2">
|
||||||
Ordina: {{ strtoupper($sortDirection) }}
|
<button type="button" onclick="window.scrollTo({top: 0, behavior: 'smooth'})" class="text-[10px] font-bold text-gray-500 hover:text-primary-600 flex items-center gap-0.5">
|
||||||
</button>
|
⬆️ Cima
|
||||||
|
</button>
|
||||||
|
<button type="button" wire:click="toggleSort" class="text-xxs font-semibold text-primary-600 hover:underline">
|
||||||
|
Ordina: {{ strtoupper($sortDirection) }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Filtro Stato Unità -->
|
<!-- Filtro Stato Unità -->
|
||||||
|
|
@ -425,7 +430,7 @@ class="text-[10px] font-bold px-2.5 py-1 rounded-lg transition-colors {{ $filtro
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
wire:model.live="search"
|
wire:model.live="search"
|
||||||
placeholder="Cerca scala, int, piano..."
|
placeholder="Cerca nominativo, scala, int, piano..."
|
||||||
class="w-full text-xs rounded-lg border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-3 py-1.5 text-gray-800 dark:text-gray-200 placeholder-gray-400"
|
class="w-full text-xs rounded-lg border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-3 py-1.5 text-gray-800 dark:text-gray-200 placeholder-gray-400"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user