Esempio n. 1
0
 public function getDuration()
 {
     $matches = MatchModel::model('MatchModel')->findAll('match_id=? and win > 0', array($this->id));
     foreach ($matches as $match) {
         $duration = intval($match->duration / 60);
         return $duration . '分钟';
     }
     return 'unknown';
 }
Esempio n. 2
0
 public function getMatches($season = '2016s2')
 {
     if (!isset($this->_matches[$season])) {
         $matches = array();
         foreach (MatchModel::model('MatchModel')->with('info')->findAll('player_id=? and info.season=?', array($this->id, $season)) as $match) {
             $matches[$match->match_id] = $match;
         }
         ksort($matches);
         $this->_matches[$season] = $matches;
     }
     return $this->_matches[$season];
 }
Esempio n. 3
0
 public function getPlayers()
 {
     $players = array();
     $matches = MatchModel::model('MatchModel')->findAll('match_id=?', array($this->match_id));
     foreach ($matches as $match) {
         if (!isset($players[$match->side])) {
             $players[$match->side] = array();
         }
         $player = $match->player;
         $player->match = $match;
         $players[$match->side][] = $player;
     }
     return $players;
 }