Example #1
0
 public function actionIndex()
 {
     $season = Season::findBySql('SELECT * FROM season WHERE invisible = 0 AND (unit1 != "" OR unit2 != "" OR unit3 != "" OR unit4 != "")')->all();
     $news = News::find()->where(['type' => '1'])->orderBy('id DESC')->one();
     $event = News::find()->where(['type' => '2'])->orderBy('id DESC')->one();
     $msgs = Chatmain::find()->orderBy('id DESC')->limit(50)->all();
     return $this->render('index', ['season' => $season, 'news' => $news, 'event' => $event, 'msgs' => $msgs]);
 }