New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
innerJoinWith and table alias in select #4143
Labels
status:to be verified
Needs to be reproduced and validated.
Comments
relations in /**
* @return \yii\db\ActiveQuery
*/
public function getClinics()
{
return $this->hasMany(Clinics::className(), ['country' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getClinics()
{
return $this->hasMany(Clinics::className(), ['city' => 'id']);
} |
When you call |
1 query do it :) different logic for analog queries. And i do write alias for pk and fk? |
Yes, you have to prefix columns to disambiguate them. |
thx for description. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i have 3 tables:
and i do 2 actions:
this query work is good -
search-city?q=query
, but requestsearch-country?q=query
call execption"Undefined index: id"
. screen exception with response format as html http://storage6.static.itmages.ru/i/14/0701/h_1404203419_2466248_4caf027d5d.pngIf i add
'id'
toselect
i get"SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in field list is ambiguous"
. Solve add'net_city.id'
and'net_country.id'
toselect
. Ended work actions:The text was updated successfully, but these errors were encountered: