eliminar historiales con historial_id null
This commit is contained in:
@@ -25,13 +25,13 @@ class ShowMantenimiento extends Component
|
||||
|
||||
$this->cont = $historialesConEstadoPendiente->toArray();
|
||||
|
||||
return view('livewire.show-mantenimiento',[
|
||||
return view('livewire.show-mantenimiento', [
|
||||
'historiales' => $historialesConEstadoPendiente
|
||||
]);
|
||||
}
|
||||
|
||||
public function seleccionarTodos(){
|
||||
|
||||
public function seleccionarTodos()
|
||||
{
|
||||
if (count($this->delete_1) == 0) {
|
||||
$this->delete_1 = array_column($this->cont['data'], 'id');
|
||||
} else {
|
||||
@@ -41,6 +41,16 @@ class ShowMantenimiento extends Component
|
||||
//dd($this->delete_1);
|
||||
}
|
||||
|
||||
public function eliminarCuentasSinHistorial()
|
||||
{
|
||||
Historial_cuenta::whereNull('historial_id')->delete();
|
||||
|
||||
$this->alert('success', 'Historiales vacios eliminados correctamente!', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function eliminarCuentas()
|
||||
{
|
||||
Historial_cuenta::whereIn('id', $this->delete_1)->delete();
|
||||
@@ -50,6 +60,5 @@ class ShowMantenimiento extends Component
|
||||
$this->alert('success', 'Historiales eliminados correctamente!', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user