selectSum('total_horas_truncadas', 'horas') ->where('idprestador', $idPrestador) ->first(); } function getHoras($idPrestador = null) { return $this ->select(['dia', 'mes', 'ano', 'total_horas_truncadas']) ->where('idprestador', $idPrestador) ->where('total_horas_truncadas >', 0) ->orderBy('ano DESC, mes DESC, dia DESC') ->findAll(); } function getSegundosMensuales($idPrestador = null) { return $this ->select(['mes', 'ano']) ->selectSum('total_horas_truncadas', 'segundos') ->where('idprestador', $idPrestador) ->groupby(['mes', 'ano']) ->findAll(); } }