Esempio n. 1
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         $params_ = ['players_slots' => $this->players_slots, 'scores_on_rate' => $this->scores_on_rate];
         $this->params = json_encode($params_);
         return true;
     } else {
         return false;
     }
 }
Esempio n. 2
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         $params_ = ['ratio_kills' => $this->ratio_kills, 'ratio_deaths' => $this->ratio_deaths, 'ratio_assists' => $this->ratio_assists, 'ratio_gold_per_min' => $this->ratio_gold_per_min, 'ratio_xp_per_min' => $this->ratio_xp_per_min, 'scores_per_pick' => $this->scores_per_pick, 'scores_per_ban' => $this->scores_per_ban, 'scores_on_rate' => $this->scores_on_rate, 'pd_players_slots' => $this->pd_players_slots, 'hd_heroes_slots' => $this->hd_heroes_slots, 'md_players_slots' => $this->md_players_slots, 'md_heroes_slots' => $this->md_heroes_slots];
         $this->params = json_encode($params_);
         return true;
     } else {
         return false;
     }
 }
Esempio n. 3
0
 public function run()
 {
     $randGame = GamesParams::getRandomGame();
     //		$fantasy = DotaFantasy::getRandomFantasy();
     //        $DotaDraft = new DotaDraft();
     //		$rates_list = $DotaDraft->getRatesListWithResults([$fantasy['id']]);
     $rates = DraftModel::getRandomRatesListWithResults($randGame);
     //		$rates_list = $rates['rates_list'];
     //        $fantasy = $rates['fantasy'];
     //        $fantasy_game = $rates['fantasy_game'];
     //echo'<pre>';print_r($fantasy);echo'</pre>';//die;
     //echo'<pre>';print_r($rates_list);echo'</pre>';//die;
     //$fantasy_game = 'Dota2';
     return $this->render('draft', ['rates' => $rates]);
 }
 /**
  * Finds the GamesParams model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return GamesParams the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = GamesParams::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }