Example #1
0
 /**
  * Run the Update
  *
  * @return mixed|void
  */
 public function call()
 {
     $pheal = $this->setScope('char')->getPheal();
     foreach ($this->api_info->characters as $character) {
         $result = $pheal->Research(['characterID' => $character->characterID]);
         foreach ($result->research as $research_agent) {
             $research_info = ResearchModel::firstOrNew(['characterID' => $character->characterID, 'agentID' => $research_agent->agentID]);
             $research_info->fill(['skillTypeID' => $research_agent->skillTypeID, 'researchStartDate' => $research_agent->researchStartDate, 'pointsPerDay' => $research_agent->pointsPerDay, 'remainderPoints' => $research_agent->remainderPoints]);
             $research_info->save();
         }
     }
     return;
 }
Example #2
0
 /**
  * Return a characters research info
  *
  * @param $character_id
  *
  * @return mixed
  */
 public function getCharacterResearchAgents($character_id)
 {
     return Research::join('invNames', 'character_researches.agentID', '=', 'invNames.itemID')->join('invTypes', 'character_researches.skillTypeID', '=', 'invTypes.typeID')->where('characterID', $character_id)->get();
 }