コード例 #1
0
 /**
  * Lists all UserFollow models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new UserFollowSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $query = new Query();
     $query->select(['user.id', 'firstname', 'lastname'])->distinct()->from('user_follow')->where('organiser_id=' . Yii::$app->user->identity->id)->join('JOIN', 'user', 'user_follow.user_id  = user.id')->all();
     // $command = $query->createCommand();
     // $data = $command->queryAll();
     $dataProvider2 = new ActiveDataProvider(['query' => $query]);
     // echo var_dump($data); die();
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'dataProvider2' => $dataProvider2]);
 }
コード例 #2
0
 /**
  * Lists all UserFollow models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new UserFollowSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }