Есть запрос
SELECT *
FROM `mmm_tr_in_import` `in_import`
LEFT JOIN `mmm_users` `user` ON `in_import`.`fulluserid` = `user`.`fulluserid`
LEFT JOIN `mmm_currency` `currency` ON `in_import`.`value_currency` = `currency`.`value_currency`
LEFT JOIN `mmm_tr_in` `duplicate` ON user_id = user.id_user
AND duplicate.currency_id = currency.id_currency
AND duplicate.paid_date_gmt = in_import.paid_date_gmt
LIMIT 0 , 30
он помогает сделать сравнение 2 таблиц с дополнительными данными.
При необходимости таблицы добавлю, но суть не в этом . Я запрос создал
$query = self::find()->alias('in_import')->joinWith(['user','currency'])
->select(['*','duplicate.*','user.id_user','currency.id_currency'])
->leftJoin(['duplicate'=>TrInModel::tableName()],
'user_id=user.id_user AND duplicate.currency_id=currency.id_currency AND duplicate.paid_date_gmt = in_import.paid_date_gmt');
Но такой запрос не дает никакой информации о таблице duplicate. В резутате запроса они просто "изчезают".
app\models\TrInImportSearch Object
(
[page_size] => 200
[_attributes:yii\db\BaseActiveRecord:private] => Array
(
[id_in_import] => 67
[fulluserid] => 300023
[paid_date_gmt] => 2001-01-20
[comment] => Пополнение счета 300023 в системе my.moneymoo.com . Без НДС
[amount] => 3
[value_currency] => RUB
[source] => 5
[payer_name] => 6
[payer_inn] => 7
[payer_bank_bik] => 8
[payer_bank_name] => 9
[payer_bank_account] => 10
[status] => 0
)
[_oldAttributes:yii\db\BaseActiveRecord:private] => Array
(
[id_in_import] => 67
[fulluserid] => 300023
[paid_date_gmt] => 2001-01-20
[comment] => Пополнение счета 300023 в системе my.moneymoo.com . Без НДС
[amount] => 3
[value_currency] => RUB
[source] => 5
[payer_name] => 6
[payer_inn] => 7
[payer_bank_bik] => 8
[payer_bank_name] => 9
[payer_bank_account] => 10
[status] => 0
)
[_related:yii\db\BaseActiveRecord:private] => Array
(
[user] => app\models\UsersModel Object
(
[newpassword] =>
[newpassword2] =>
[password_1] =>
[password_2] =>
[f_login] =>
[f_email] =>
[city_name] =>
[_companies:app\models\UsersModel:private] => Array
(
)
[_attributes:yii\db\BaseActiveRecord:private] => Array
(
[id_user] => 23
[fulluserid] => 300023
[role] => client
[first_name] => уаукпкупкуц
[last_name] => Серобаба
[email] => fsdfs242@gd.fds1
[password] => e10adc3949ba59abbe56e057f20f883e
[created_gmt] => 2017-01-06 01:13:55
[date_birth] => 2017-01-16
[gender] => male
[phone] => +7 987 978-77-87
[active] => 0
[country_id] => 3
[city_id] => 231
[timezone_gmt] => 9
[blocked] => 0
[auth_key] => 6c20fb6820455b81db622772465d13a1
[del] => 0
)
[_oldAttributes:yii\db\BaseActiveRecord:private] => Array
(
[id_user] => 23
[fulluserid] => 300023
[role] => client
[first_name] => уаукпкупкуц
[last_name] => Серобаба
[email] => fsdfs242@gd.fds1
[password] => e10adc3949ba59abbe56e057f20f883e
[created_gmt] => 2017-01-06 01:13:55
[date_birth] => 2017-01-16
[gender] => male
[phone] => +7 987 978-77-87
[active] => 0
[country_id] => 3
[city_id] => 231
[timezone_gmt] => 9
[blocked] => 0
[auth_key] => 6c20fb6820455b81db622772465d13a1
[del] => 0
)
[_related:yii\db\BaseActiveRecord:private] => Array
(
)
[_errors:yii\base\Model:private] =>
[_validators:yii\base\Model:private] =>
[_scenario:yii\base\Model:private] => default
[_events:yii\base\Component:private] => Array
(
)
[_behaviors:yii\base\Component:private] => Array
(
)
)
[currency] => app\models\CurrencyModel Object
(
[_attributes:yii\db\BaseActiveRecord:private] => Array
(
[id_currency] => 1
[value_currency] => RUB
[value_currency_long] => Russin Ruble
)
[_oldAttributes:yii\db\BaseActiveRecord:private] => Array
(
[id_currency] => 1
[value_currency] => RUB
[value_currency_long] => Russin Ruble
)
[_related:yii\db\BaseActiveRecord:private] => Array
(
)
[_errors:yii\base\Model:private] =>
[_validators:yii\base\Model:private] =>
[_scenario:yii\base\Model:private] => default
[_events:yii\base\Component:private] => Array
(
)
[_behaviors:yii\base\Component:private] => Array
(
)
)
)
[_errors:yii\base\Model:private] =>
[_validators:yii\base\Model:private] =>
[_scenario:yii\base\Model:private] => default
[_events:yii\base\Component:private] => Array
(
)
[_behaviors:yii\base\Component:private] => Array
(
)
)
Кто подскажет где искать или как задать по другому?