filtros por detalle y fecha
This commit is contained in:
@@ -8,10 +8,23 @@ use Livewire\Component;
|
||||
class ShowLogGeneral extends Component
|
||||
{
|
||||
public $entradas;
|
||||
|
||||
public $buscar;
|
||||
public $filtro_fecha;
|
||||
|
||||
public function render()
|
||||
{
|
||||
$logs = Log_general::orderby('id', 'desc')->paginate($this->entradas);
|
||||
$query = Log_general::query();
|
||||
|
||||
if ($this->buscar) {
|
||||
$query->where('detalle', 'like', '%' . $this->buscar . '%');
|
||||
}
|
||||
|
||||
if ($this->filtro_fecha) {
|
||||
$query->whereDate('created_at', $this->filtro_fecha);
|
||||
}
|
||||
|
||||
$logs = $query->orderBy('id', 'desc')->paginate($this->entradas);
|
||||
|
||||
return view('livewire.show-log-general', [
|
||||
'logs' => $logs
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
</div>
|
||||
|
||||
{{-- Buscador --}}
|
||||
<div
|
||||
class="bg-[#f5f5f5] m-auto p-2 md:p-5 rounded-[1.2rem] w-auto mb-4 x-auto grid grid-cols-1 lg:grid-cols-1text-center rounded-xl py-4 px-2 ms:px-8 xl:mx-10 mb-8 ">
|
||||
<div class="bg-[#f5f5f5] m-auto p-2 md:p-5 w-auto x-auto grid grid-cols-1 lg:grid-cols-1text-center rounded-xl py-4 px-2 ms:px-8 xl:mx-10 mb-8 ">
|
||||
<div class="md:flex justify-center my-2 items-center text-center ">
|
||||
<div class="flex text-sm">
|
||||
<svg class="w-4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
|
||||
@@ -1,6 +1,28 @@
|
||||
<div class="h-full w-full md:my-2">
|
||||
<div class="bg-[#f5f5f5] m-auto p-2 md:p-5 w-auto x-auto grid grid-cols-1 lg:grid-cols-1text-center rounded-xl py-4 px-2 ms:px-8 xl:mx-10 mb-8 ">
|
||||
|
||||
<div class="md:flex justify-center my-2 items-center text-center ">
|
||||
<div class="flex text-sm">
|
||||
<svg class="w-4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve">
|
||||
<path d="M15.4,9.88,10.81,5.29a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42L14,11.29a1,1,0,0,1,0,1.42L9.4,17.29a1,1,0,0,0,1.41,1.42l4.59-4.59A3,3,0,0,0,15.4,9.88Z" fill="#b221fd" data-original="#000000" />
|
||||
</svg>
|
||||
Log general
|
||||
</div>
|
||||
<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" class="shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 w-64 md:w-auto rounded-[0.8rem] 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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="w-4 absolute" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512;rotate: 90deg;" xml:space="preserve" class="">
|
||||
<g id="Layer_31" data-name="Layer 31">
|
||||
<path d="m21.71 20.29-5.4-5.39a7.92 7.92 0 0 0 1.69-4.9 8 8 0 1 0 -8 8 7.92 7.92 0 0 0 4.9-1.69l5.39 5.4a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zm-17.71-10.29a6 6 0 1 1 6 6 6 6 0 0 1 -6-6z" fill="#b221fd" data-original="#000000" class=""></path>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="text-sm mr-auto">
|
||||
<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-[0.8rem] pr-7 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<x-ver-entrada />
|
||||
|
||||
<x-primary-table>
|
||||
|
||||
Reference in New Issue
Block a user