Initial commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use App\Models\Configuracione;
|
||||
use App\Models\User;
|
||||
use Livewire\Component;
|
||||
use Jantinnerezo\LivewireAlert\LivewireAlert;
|
||||
|
||||
class ShowTop extends Component
|
||||
{ public $configuracion;
|
||||
|
||||
use LivewireAlert;
|
||||
|
||||
public function render()
|
||||
{
|
||||
$this->configuracion = Configuracione::orderby('id','desc')->first();
|
||||
|
||||
$consulta_ventas = User::with(['historiales_venta' => function ($query) {
|
||||
$query->whereMonth('fecha_inicio', date('m'));
|
||||
}])
|
||||
->withCount(['historiales_venta' => function ($query) {
|
||||
$query->whereMonth('fecha_inicio', date('m'));
|
||||
}])
|
||||
->orderBy('historiales_venta_count', 'desc')
|
||||
->limit(10)
|
||||
->get();
|
||||
|
||||
|
||||
//dd($consulta_ventas);
|
||||
return view('livewire.show-top',[
|
||||
'usuarios' => $consulta_ventas,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user