log historial

This commit is contained in:
Felipe
2024-03-08 16:40:17 -05:00
parent 3ec412ea55
commit e1e23686d4
3 changed files with 18 additions and 6 deletions
+7 -1
View File
@@ -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);
}