示例#1
0
 /**
  * @return string
  */
 public function actionIndex()
 {
     $query = Fight::find();
     $fu = FightUser::tableName();
     $query->join('LEFT JOIN', $fu, $fu . '.fight_id = ' . Fight::tableName() . '.id AND ' . $fu . '.user_id = ' . \Yii::$app->user->getIdentity()->cid);
     $query->where($fu . '.id IS NULL');
     $query->orderBy('created_at DESC');
     $items = new ActiveDataProvider(['query' => $query, 'sort' => false]);
     return $this->render('index', ['items' => $items, 'model' => new FightForm()]);
 }