log historial
This commit is contained in:
@@ -21,9 +21,15 @@ class ShowLogHistorial extends Component
|
||||
$query = Log_historial::query();
|
||||
|
||||
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) {
|
||||
$query->whereDate('created_at', $this->filtro_fecha);
|
||||
}
|
||||
|
||||
@@ -232,6 +232,8 @@ class ShowPlanes extends Component
|
||||
'confirmButtonText' => 'Si, liberar cuenta',
|
||||
]);
|
||||
}else{
|
||||
$cuenta_renovar = Cuentas::find($this->id_cuentaVer);
|
||||
|
||||
Cuentas::where('id', $this->id_cuentaVer)->update([
|
||||
'correo' => $this->usuario_renovar,
|
||||
'password' => $this->password_renovar,
|
||||
@@ -240,6 +242,11 @@ class ShowPlanes extends Component
|
||||
'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!', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
@@ -267,7 +274,7 @@ class ShowPlanes extends Component
|
||||
|
||||
Log_historial::create([
|
||||
'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!', [
|
||||
@@ -294,7 +301,7 @@ class ShowPlanes extends Component
|
||||
|
||||
Log_historial::create([
|
||||
'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!', [
|
||||
|
||||
Reference in New Issue
Block a user