public function actionGameResult() { $masterId = CommonFunction::getUserId(); $leagueModel = new LeagueModel(); //判断用户是否有管理联赛的权限 $res = $leagueModel->allowEditLeague($masterId); $leagueId = $res->results[0]->objectId; $content = CommonFunction::ob2ar($res); foreach ($content["results"] as $key) { echo $key["name"]; } $teamModel = new TeamModel(); $tournamentModel = new TournamentModel(); $leagueTeams = $teamModel->findRowsByRelation("teams", "League", $leagueId); $games = array(); $games = $tournamentModel->findByLeague($leagueId); foreach ($games as $k => $game) { //比赛开始后2小时,认为比赛结束 if (time() - strtotime($game->start_time->iso) > 7200) { unset($games[$k]); } } $this->render('gameResult', array('leagueTeams' => $leagueTeams, 'games' => $games)); }
</div> </div> </div> <div class="col-md-3"> <?php echo $this->renderPartial('//manage/_sidebar', array('leagueTeams' => $leagueTeams)); ?> </div> </div> </div> <div id="select_group_team" style="display: none"> <form class="form-horizontal" id="form-select-team" role="form"> <ul class="row"> <?php $leagueTeams = CommonFunction::ob2ar($leagueTeams); foreach ($leagueTeams as $team) { ?> <li class="col-md-4"> <div class="checkbox"> <label> <input type="checkbox" class="form-select-box" <?php if (isset($team["selected"])) { echo 'disabled="disabled" "status"="selected"'; } ?> data-teamid="<?php echo $team["objectId"]; ?> " data-teamname="<?php echo $team["name"];