public function peersAction($typeId, $step = 1) { $page = $step - 1; if (Request::isMethod('post')) { } else { //data dari session $nip = Auth::user()->nip; $jabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $nip); //cek peers $peers = CompetencyPeers::getSoftPeers($this->competencyData->id, $nip); if ($peers != null) { //get jabatan Array $jabatanArray = RiwJabStruk::getJabatanofPeers($this->competencyData->date_start, $peers); //get profile by jabatan Array $profiles = CompetencyProfile::getProfilefromPeers($this->competencyData->id, $jabatanArray, $typeId)->take(1)->skip($page)->first(); //get jabatan from profiles $jabatanProfile = CompetencyProfile::getJabatanfromProfile($this->competencyData->id, $profiles->competency_dictionary_id); //get user detail from jabatan $jabatan = array_intersect($jabatanArray, $jabatanProfile); $users = RiwJabStruk::getUserfromJabatan($this->competencyData->date_start, $jabatan); $this->layout->content = View::make('competency::test.peers', compact('profiles', 'users')); } else { dd('error'); } } }