Open GoogleCodeExporter opened 8 years ago
Could you please paste here the line and the line of the error and the
generated query? Thank you.
Original comment by rodrigo.coelho@gmail.com
on 27 May 2011 at 12:46
I mean the **file** and the line of the error.
Original comment by rodrigo.coelho@gmail.com
on 27 May 2011 at 12:47
Rodrigo is not a "mistake" of the giix.
The problem I mentioned is the necessity of having to change the base file,
which should remain untouched.
This could be solved if the giix generate the search criteria with the alias of
the tables.
Original comment by thiagota...@gmail.com
on 27 May 2011 at 1:21
Yes, if I can make giix better by generating the search criteria with the alias
of the tables, I'll be happy.
But for that I'll need to understand what is happening. If you can send me more
information, like the requested above, that will help. Thank you!
Original comment by rodrigo.coelho@gmail.com
on 27 May 2011 at 1:26
A brief example of the situation.
Table Company
-----------
id_company (pk)
nm_company
Table Employee
----------
id_employee (pk)
id_company (fk)
nm_employee
Controller: employee/list
--------------
CGridView
'dataProvider'=>Employee::model()->with('company')->search();
In the search form, if I search by company id, I get the error shown above.
This is because the query will be the two tables, employee and company, and the
search criteria will be only 'id_company' = :yp0.
As this field exists in both tables, the database complains ambiguity.
since in the consultation will be two tables, employee and company, and the
search criteria will be x.
Original comment by thiagota...@gmail.com
on 27 May 2011 at 1:59
Thank you for the information.
Original comment by rodrigo.coelho@gmail.com
on 27 May 2011 at 9:11
Original comment by rodrigo.coelho@gmail.com
on 27 May 2011 at 9:22
Thank you for your attention.
Did you see the other questions that I opened?
I opened another question also about the search() that is given priority over
that. Without the modification of the first, this problem does not happen,
since no one has the possibility to use scopes or criteria in the model. That
sucks because it forces us to work with lazy load.
Original comment by thiagota...@gmail.com
on 27 May 2011 at 11:03
Ok, thanks for the information.
Original comment by rodrigo.coelho@gmail.com
on 27 May 2011 at 12:46
Original issue reported on code.google.com by
thiagota...@gmail.com
on 26 May 2011 at 10:01