SELECT `myalias`.* FROM `blog` `myalias` LEFT JOIN `blog_desc` ON (`myalias`.`id` = `blog_desc`.`blog_id`) AND (`lang`='ru')
There is no table name or table alias at (lang='ru'), so:
1) can't using chained joins with different aliases;
2) have conflicts if "lang" belongs to different tables;
The right way is using table name or current alias before field name.
Have some relation with onCondition:
Then using with aliases:
Generated SQL:
There is no table name or table alias at (
lang
='ru'), so: 1) can't using chained joins with different aliases; 2) have conflicts if "lang" belongs to different tables;The right way is using table name or current alias before field name.
| ---------------- | --- | Yii version | 2.0.24