Базы ( обе mysql )на разных машинах. В модели таблицы table3 указано соединение connect2. В документации же сказано :Base table or view not found: 1146 Table 'connect1.table3' doesn't exist
, С пометкойActive Record allows you to declare relations between Active Record classes that are powered by different databases. The databases can be of different types (e.g. MySQL and PostgreSQL, or MS SQL and MongoDB), and they can run on different servers. You can use the same syntax to perform relational queries.
Итоговый объект запроса прилагаю:Note: Usage of joinWith() is limited to databases that allow cross-database JOIN queries. For this reason, you cannot use this method in the above example because MongoDB does not support JOIN.
Код: Выделить всё
{
"sql": null,
"on": null,
"joinWith": [
[
[
"relarion1"
],
false,
"LEFT JOIN"
],
[
[
"relation2"
],
false,
"LEFT JOIN"
],
[
[
"relation3"
],
false,
"LEFT JOIN"
],
[
[
"relation4.subrelation"
],
false,
"LEFT JOIN"
],
[
[
"relation6.subrelation"
],
false,
"LEFT JOIN"
],
[
[
"relation7"
],
false,
"LEFT JOIN"
]
],
"select": [],
"selectOption": null,
"distinct": "",
"from": {
"clients_ph": "clients_ph"
},
"groupBy": null,
"join": null,
"having": null,
"union": null,
"params": [],
"where": [
"between",
"relation3.field",
"10",
"1000"
],
"limit": null,
"offset": null,
"orderBy": null,
"indexBy": null,
"emulateExecution": false,
"modelClass": "app\\models\\ClientsPh",
"with": null,
"asArray": null,
"multiple": null,
"primaryModel": null,
"link": null,
"via": null,
"inverseOf": null
}
Помогите разобраться, что я делаю не так. Заранее спасибо.