Exemple #1
0
 public static function getArticleComments($articleId)
 {
     $query = ArticleComments::find();
     //$query->addSelect('article_comments.*,profile.firstname,profile.lastname');
     $query->with('commentOwner');
     //$query->innerJoin('profile', 'profile.user_id=article_comments.user_id');
     $query->andFilterWhere(['article_id' => $articleId]);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 6], 'sort' => ['defaultOrder' => ['id' => SORT_DESC]]]);
     return $dataProvider;
 }