Selecting columns from two tables Yii2

Viewed 891

I have a join query between tables(t1,t2) that needs to select some columns from BOTH tables .

Doing something like :

t1::find()->select("t1.id , t2.id")->innerJoin('t2 ...)

but, it doesn't retrieve t2.id .

How to do it in Yii ?

The corresponding MySql query :

select t1.id , t2.id from t1 inner join t2 on t1.id = t2.id;
1 Answers
Related