cuando sea diciembre y le damos mes pasado me va a mostrar los del ano pasado
This commit is contained in:
@@ -22,9 +22,9 @@ class ShowTop extends Component
|
|||||||
{
|
{
|
||||||
$this->configuracion = Configuracione::orderby('id', 'desc')->first();
|
$this->configuracion = Configuracione::orderby('id', 'desc')->first();
|
||||||
|
|
||||||
$currentYear = date('Y');
|
|
||||||
$monthYear = date('m-Y', strtotime('last month'));
|
$monthYear = date('m-Y', strtotime('last month'));
|
||||||
$month = $this->showLastMonth ? date('m', strtotime('last month')) : date('m');
|
$month = $this->showLastMonth ? date('m', strtotime('last month')) : date('m');
|
||||||
|
$currentYear = $this->showLastMonth && $month == 12 ? date('Y', strtotime('last year')) : date('Y');
|
||||||
|
|
||||||
$consulta_ventas = User::with(['historiales_venta' => function ($query) use ($month, $currentYear) {
|
$consulta_ventas = User::with(['historiales_venta' => function ($query) use ($month, $currentYear) {
|
||||||
$query->whereMonth('fecha_inicio', $month)
|
$query->whereMonth('fecha_inicio', $month)
|
||||||
|
|||||||
Reference in New Issue
Block a user