Answer the question
In order to leave comments, you need to log in
What's wrong with the request?
Help me please!! I've been sitting on this for an hour now. I have no idea what to do.
Saw a chela on Stack OverFlow with the same problem, but they did not help him ((
Here is the code
$questions = Question::find()
->joinWith('questionToTagTags')
->where(['questionToTagTags.tag_id' => $tag_id, 'status' => 1])
->andWhere(['!=', 'id', $question_id])
->with('comments', 'userToQuestionSubs')
->limit(10)
->all();
$questions_query = Question::find()
->joinWith('comments')
->where(['status' => 1, 'comments.question_id' => null])
->with('questionToTagTags.tag', 'userToQuestionSubs')
->orderBy('id DESC');
public function getQuestionToTagTags()
{
return $this->hasMany(QuestionToTagTags::class, ['question_id' => 'id']);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question