[viewBag] == no; $year = $this->year; $prodId = $this->prodId; $allAmount = $this->all_amount; $amountCalc = Romanah\Gokbakja\Models\ProductionCalculate::where('product_id', $prodId)->whereMonth('date', $no)->whereYear('date', $year)->sum("amount_calc"); if ($amountCalc != null){ $this["pivot_calc"] = $amountCalc; }else{ $this["pivot_calc"] = 0; } } ?> ==