Hi everyone
I have a strange issue in cgridview with sorting or searching a related AR model
If the related field is first lever everything works fine
for example $criteria->compare('category.category_id', $this->rel_catid, true); (category is related with product)
but in this case occurs error "CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found"
$criteria->compare('category.groups.group_id', $this->rel_group, true); (category is related with product, and group related with category)
in the message error I can see only one LEFT OUTER JOIN with category but I do not see JOIN with group table.
I am sure the relation exist (I created by myself) also there is no problem with echo $modelProduct->category->groups->group_id in view file.
The same problem occurs when I sorting the specific field in CGridView
What I am missing?
Thanks
I have a strange issue in cgridview with sorting or searching a related AR model
If the related field is first lever everything works fine
for example $criteria->compare('category.category_id', $this->rel_catid, true); (category is related with product)
but in this case occurs error "CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found"
$criteria->compare('category.groups.group_id', $this->rel_group, true); (category is related with product, and group related with category)
in the message error I can see only one LEFT OUTER JOIN with category but I do not see JOIN with group table.
I am sure the relation exist (I created by myself) also there is no problem with echo $modelProduct->category->groups->group_id in view file.
The same problem occurs when I sorting the specific field in CGridView
What I am missing?
Thanks