title = "All production by month" url = "/all-production-month/:month/:year?" layout = "platform_main" is_hidden = 0 == timezone('UTC +05:00'); $this["month"] = $this->param("month"); $year = $this->param("year"); $this["reportProducts"] = Romanah\Gokbakja\Models\Product::where("report", "simple")->get(); if($this["month"] == 'default'){ $this["month"] = $currentDate->month; } if($year){ $this["productions"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', $this["month"])->whereYear('created_at', $year)->with(['pivot_production'])->get(); $this["month_all_amount"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', $this["month"]) ->whereYear('created_at', $year) ->avg('all_amount'); }else{ $this["productions"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', $this["month"])->whereYear('created_at', $currentDate->year)->with(['pivot_production'])->get(); $this["month_all_amount"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', $this["month"]) ->whereYear('created_at', $currentDate->year) ->avg('all_amount'); } } ?> == {% put styles %} {% endput %}

Aýlar Boýunça {{year}}

{% partial 'dataTableJs' %}