From c1e72339c126009f779da5d3f8798a67799e0468 Mon Sep 17 00:00:00 2001 From: lizandrogd <77708265+lizandrogd@users.noreply.github.com> Date: Fri, 4 Apr 2025 20:11:51 -0500 Subject: [PATCH] UPDATE --- app/Http/Livewire/LogsRecargas.php | 2 +- app/Http/Livewire/PortadaServicio.php | 2 +- app/Http/Livewire/ShowClientes.php | 4 ++-- app/Http/Livewire/ShowLogGeneral.php | 2 +- app/Http/Livewire/ShowLogHistorial.php | 6 +++--- app/Http/Livewire/ShowLogs.php | 4 ++-- app/Http/Livewire/ShowPlanes.php | 4 ++-- app/Http/Livewire/ShowUsuarios.php | 8 ++++---- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/Http/Livewire/LogsRecargas.php b/app/Http/Livewire/LogsRecargas.php index 2a42df0..1993004 100755 --- a/app/Http/Livewire/LogsRecargas.php +++ b/app/Http/Livewire/LogsRecargas.php @@ -21,7 +21,7 @@ class LogsRecargas extends Component if (!empty($this->buscar)) { $consulta_historial->whereHas('usuario', function ($query) { - $query->where('email', 'like', '%' . $this->buscar . '%'); + $query->where('email', 'ILIKE', '%' . $this->buscar . '%'); }); } diff --git a/app/Http/Livewire/PortadaServicio.php b/app/Http/Livewire/PortadaServicio.php index ebde9d0..69d4d66 100755 --- a/app/Http/Livewire/PortadaServicio.php +++ b/app/Http/Livewire/PortadaServicio.php @@ -97,7 +97,7 @@ class PortadaServicio extends Component $consulta_promociones = Promociones::with('tarifas')->where('visible', 'true'); if (!is_null($this->categoria_id)) { - $consulta_promociones = $consulta_promociones->where('categoria_id', 'LIKE', '%' . $this->categoria_id . '%'); + $consulta_promociones = $consulta_promociones->where('categoria_id', 'ILIKE', '%' . $this->categoria_id . '%'); } //dd($consulta_promociones->get()); $consulta_promociones = $consulta_promociones->get(); diff --git a/app/Http/Livewire/ShowClientes.php b/app/Http/Livewire/ShowClientes.php index 6499e89..7bc2892 100755 --- a/app/Http/Livewire/ShowClientes.php +++ b/app/Http/Livewire/ShowClientes.php @@ -65,9 +65,9 @@ class ShowClientes extends Component if (!empty($this->buscar)) { $consulta_clientes = $consulta_clientes->where(function ($query) { $query->whereHas('cuentas', function ($subQuery) { - $subQuery->where('correo', 'LIKE', '%' . $this->buscar . '%'); + $subQuery->where('correo', 'ILIKE', '%' . $this->buscar . '%'); })->orWhereHas('cliente', function ($subQuery) { - $subQuery->where('email', 'LIKE', '%' . $this->buscar . '%'); + $subQuery->where('email', 'ILIKE', '%' . $this->buscar . '%'); }); }); } diff --git a/app/Http/Livewire/ShowLogGeneral.php b/app/Http/Livewire/ShowLogGeneral.php index d876c42..f705f8d 100755 --- a/app/Http/Livewire/ShowLogGeneral.php +++ b/app/Http/Livewire/ShowLogGeneral.php @@ -19,7 +19,7 @@ class ShowLogGeneral extends Component $query = Log_general::query(); if ($this->buscar) { - $query->where('detalle', 'like', '%' . $this->buscar . '%'); + $query->where('detalle', 'ILIKE', '%' . $this->buscar . '%'); } if ($this->filtro_fecha) { diff --git a/app/Http/Livewire/ShowLogHistorial.php b/app/Http/Livewire/ShowLogHistorial.php index 7791c52..0018523 100644 --- a/app/Http/Livewire/ShowLogHistorial.php +++ b/app/Http/Livewire/ShowLogHistorial.php @@ -25,16 +25,16 @@ class ShowLogHistorial extends Component if ($this->buscar) { $query->where(function ($query) { - $query->where('detalle', 'like', '%' . $this->buscar . '%') + $query->where('detalle', 'ILIKE', '%' . $this->buscar . '%') ->orWhereHas('user', function ($query) { - $query->where('name', 'like', '%' . $this->buscar . '%'); + $query->where('name', 'ILIKE', '%' . $this->buscar . '%'); }); }); } if ($this->tipo) { - $query->where('detalle', 'like', '%' . $this->tipo . '%'); + $query->where('detalle', 'ILIKE', '%' . $this->tipo . '%'); } if ($this->filtro_fecha) { diff --git a/app/Http/Livewire/ShowLogs.php b/app/Http/Livewire/ShowLogs.php index 0417b9b..9f45d18 100755 --- a/app/Http/Livewire/ShowLogs.php +++ b/app/Http/Livewire/ShowLogs.php @@ -18,9 +18,9 @@ class ShowLogs extends Component $consulta_historial = Historiale::with('promocion', 'tarifa', 'vendedor','cuentas','cuentas_obsoletas')->whereDate('fecha_final','>', $fechaVencimiento)->orderBy('id', 'DESC') ->when(!empty($this->buscar), function ($query) { $query->whereHas('cuentas', function ($subquery) { - $subquery->where('correo', 'LIKE', '%' . $this->buscar . '%'); + $subquery->where('correo', 'ILIKE', '%' . $this->buscar . '%'); })->orWhereHas('vendedor', function ($subquery) { - $subquery->where('email', 'LIKE', '%' . $this->buscar . '%'); + $subquery->where('email', 'ILIKE', '%' . $this->buscar . '%'); }); }); // Limitar resultados a un máximo de 200 diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index 912c255..2c2b37f 100755 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -139,7 +139,7 @@ class ShowPlanes extends Component } // Empezamos definiendo la consulta básica - $consulta_cuentas = Cuentas::where('correo', 'LIKE', '%' . $this->buscar . '%') + $consulta_cuentas = Cuentas::where('correo', 'ILIKE', '%' . $this->buscar . '%') ->withCount('historiales') ->with('historiales') ->orderBy('id', 'DESC'); @@ -178,7 +178,7 @@ class ShowPlanes extends Component $consulta_cuentas = $consulta_cuentas->paginate($this->entradas); if ($this->searchTerm) { - $this->usuarios = User::where('email', 'LIKE', '%' . $this->searchTerm . '%')->get(); + $this->usuarios = User::where('email', 'ILIKE', '%' . $this->searchTerm . '%')->get(); if ($this->selectedOption) { $this->searchTerm = $this->selectedOption; } diff --git a/app/Http/Livewire/ShowUsuarios.php b/app/Http/Livewire/ShowUsuarios.php index 8194636..a43345c 100755 --- a/app/Http/Livewire/ShowUsuarios.php +++ b/app/Http/Livewire/ShowUsuarios.php @@ -110,8 +110,8 @@ class ShowUsuarios extends Component $query->where('visible', 'true'); }]) ->where(function ($query) { - $query->where('name', 'LIKE', '%' . $this->buscar . '%') - ->orWhere('email', 'LIKE', '%' . $this->buscar . '%'); + $query->where('name', 'ILIKE', '%' . $this->buscar . '%') + ->orWhere('email', 'ILIKE', '%' . $this->buscar . '%'); }); if ($this->verPreciosPersonalizados) { @@ -136,13 +136,13 @@ class ShowUsuarios extends Component if (!empty($this->buscar_servicio)) { $this->consulta_tarifas = Tarifas::where('rol_id', $this->rol_usuario)->with([ 'servicio' => function ($query) { - $query->Where('nombre', 'LIKE', '%' . $this->buscar_servicio . '%'); + $query->Where('nombre', 'ILIKE', '%' . $this->buscar_servicio . '%'); } ])->get(); } if (!empty($this->buscar_promo)) { - $this->consulta_promo = Promociones::where('visible', '!=', 'false')->where('nombre', 'like', '%' . $this->buscar_promo . '%')->get(); + $this->consulta_promo = Promociones::where('visible', '!=', 'false')->where('nombre', 'ILIKE', '%' . $this->buscar_promo . '%')->get(); } if ($this->gestionPromo == true) {