A
A
alex995052018-08-10 00:28:15
Yii
alex99505, 2018-08-10 00:28:15

How to select a field with JOIN by tie in Yii1?

There are two links like this:
'q_comp' => array(self::HAS_ONE, 'Questions', array('event_id'=>'event_id'),'on' => 'q_comp.link_company=1', 'through' =>'q_ans_comp'),
'q_ans_comp' => array(self::BELONGS_TO, 'QuestionAnswers', array('question_user_id'=>'id'), 'on' => 'q_ans_comp.question_id=q_comp.id') ,
The QuestionAnswers table has an answer field. Tell me what you need to specify so that the answer is pulled over the q_comp link, that is:
$data->q_comp ->answer

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question