log historial
This commit is contained in:
@@ -21,9 +21,15 @@ class ShowLogHistorial extends Component
|
|||||||
$query = Log_historial::query();
|
$query = Log_historial::query();
|
||||||
|
|
||||||
if ($this->buscar) {
|
if ($this->buscar) {
|
||||||
$query->where('detalle', 'like', '%' . $this->buscar . '%');
|
$query->where(function ($query) {
|
||||||
|
$query->where('detalle', 'like', '%' . $this->buscar . '%')
|
||||||
|
->orWhereHas('user', function ($query) {
|
||||||
|
$query->where('name', 'like', '%' . $this->buscar . '%');
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($this->filtro_fecha) {
|
if ($this->filtro_fecha) {
|
||||||
$query->whereDate('created_at', $this->filtro_fecha);
|
$query->whereDate('created_at', $this->filtro_fecha);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,6 +232,8 @@ class ShowPlanes extends Component
|
|||||||
'confirmButtonText' => 'Si, liberar cuenta',
|
'confirmButtonText' => 'Si, liberar cuenta',
|
||||||
]);
|
]);
|
||||||
}else{
|
}else{
|
||||||
|
$cuenta_renovar = Cuentas::find($this->id_cuentaVer);
|
||||||
|
|
||||||
Cuentas::where('id', $this->id_cuentaVer)->update([
|
Cuentas::where('id', $this->id_cuentaVer)->update([
|
||||||
'correo' => $this->usuario_renovar,
|
'correo' => $this->usuario_renovar,
|
||||||
'password' => $this->password_renovar,
|
'password' => $this->password_renovar,
|
||||||
@@ -240,6 +242,11 @@ class ShowPlanes extends Component
|
|||||||
'estado' => $this->estado,
|
'estado' => $this->estado,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Log_historial::create([
|
||||||
|
'user_id' => Auth::user()->id,
|
||||||
|
'detalle' => 'El usuario ha editado la cuenta ' . $cuenta_renovar->correo
|
||||||
|
]);
|
||||||
|
|
||||||
$this->alert('success', 'Cuenta actualizada correctamente!', [
|
$this->alert('success', 'Cuenta actualizada correctamente!', [
|
||||||
'position' => 'top'
|
'position' => 'top'
|
||||||
]);
|
]);
|
||||||
@@ -267,7 +274,7 @@ class ShowPlanes extends Component
|
|||||||
|
|
||||||
Log_historial::create([
|
Log_historial::create([
|
||||||
'user_id' => Auth::user()->id,
|
'user_id' => Auth::user()->id,
|
||||||
'detalle' => 'El usuario ha renovado la cuenta ' . $cuenta_renovar->correo
|
'detalle' => 'El usuario ha editado, renovado y liberado la cuenta ' . $cuenta_renovar->correo
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->alert('success', 'Cuenta renovada y liberada correctamente!', [
|
$this->alert('success', 'Cuenta renovada y liberada correctamente!', [
|
||||||
@@ -294,7 +301,7 @@ class ShowPlanes extends Component
|
|||||||
|
|
||||||
Log_historial::create([
|
Log_historial::create([
|
||||||
'user_id' => Auth::user()->id,
|
'user_id' => Auth::user()->id,
|
||||||
'detalle' => 'El usuario ha renovado la cuenta ' . $cuenta_renovar->correo
|
'detalle' => 'El usuario ha editado y renovado la cuenta ' . $cuenta_renovar->correo
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->alert('success', 'Cuenta renovada correctamente!', [
|
$this->alert('success', 'Cuenta renovada correctamente!', [
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
Log historial
|
Log historial
|
||||||
</div>
|
</div>
|
||||||
<div class="flex relative text-sm mx-auto w-64 md:w-auto my-2">
|
<div class="flex relative text-sm mx-auto w-64 md:w-auto my-2">
|
||||||
<input id="buscar" type="search" wire:model.lazy="buscar" placeholder="Buscar"
|
<input id="buscar" type="search" wire:model.debounce.500ms="buscar" placeholder="Buscar"
|
||||||
class="shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 w-64 md:w-auto rounded-lg pr-7 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
|
class="shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 w-64 md:w-auto rounded-lg pr-7 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
|
||||||
<svg class="w-5 absolute top-2 right-3" xmlns="http://www.w3.org/2000/svg" version="1.1"
|
<svg class="w-5 absolute top-2 right-3" xmlns="http://www.w3.org/2000/svg" version="1.1"
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="w-4 absolute"
|
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="w-4 absolute"
|
||||||
@@ -27,8 +27,7 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
<div class="text-sm">
|
<div class="text-sm">
|
||||||
<input type="date" wire:model="filtro_fecha"
|
<input type="date" wire:model="filtro_fecha" class="shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 w-64 md:w-auto rounded-lg pr-7 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
|
||||||
class="shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 w-64 md:w-auto rounded-lg pr-7 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user