예제 #1
0
 /**
  * Lists all Confronto models.
  * @return mixed
  */
 public function actionIndex($id = 0)
 {
     if ($id != 0) {
         $dataProvider = Confronto::find()->where(['=', 'id_grupo', $id])->all();
     } else {
         $dataProvider = Confronto::find()->all();
     }
     return $this->render('index', ['confrontos' => $dataProvider]);
 }
예제 #2
0
 public static function GetNEmpateDoTime($id)
 {
     $pontos = 0;
     $model = new Confronto();
     $model = Confronto::find()->where(['=', 'id_time_casa', $id])->andWhere(['=', 'id_time_visitante', $id])->andWhere(['=', 'empate', 1])->all();
     foreach ($model as $ponto) {
         $pontos = $pontos + 1;
     }
     return $pontos;
 }