Beispiel #1
0
 /**
  * считает кол-во очков по смешанному драфту
  * @param $fantasy array
  * @param $rates array
  */
 private static function calculateScoresInMixedDraft($fantasy, $rates)
 {
     $draft_ids = $draft_info = [];
     $DotaDraft = new DotaDraft();
     foreach ($rates as $rate) {
         $draft_ids[] = $rate['draft_id'];
     }
     $draft_info_heroes = DotaDraftHero::getDraftsInfo($draft_ids);
     $draft_info_players = DotaDraftPlayer::getDraftsInfo($draft_ids);
     //echo'<pre>';print_r($draft_info_heroes);echo'</pre>';//die;
     //echo'<pre>';print_r($draft_info_players);echo'</pre>';//die;
     foreach ($draft_info_heroes as $key => $row) {
         $draft_info[$key]['heroes'] = $row;
     }
     foreach ($draft_info_players as $key => $row) {
         $draft_info[$key]['players'] = $row;
     }
     //echo'<pre>';print_r($draft_info);echo'</pre>';die;
     foreach ($draft_info as $draft_id => $row) {
         $DotaDraft->setScoresForMixedDraft($draft_id, $fantasy['event_id'], $row);
     }
     //die;
 }