searching and sorting

Hello

I added some criteria to search() metod

$criteria->join = ‘join wojewodztwo t1 on (t.wojewodztwo_id = t1.id and t1.name like :word)’;

$criteria->params[’:word’]="%{$this->wojewodztwo_id}%";

column name appears in both models,

now i cant sort by name of first model because it sorting by name no by t.name.

2010/06/29 16:51:33 [error] [system.db.CDbCommand] Error in querying SQL: SELECT * FROM serwis t join wojewodztwo t1 on (t.wojewodztwo_id = t1.id and t1.name l

ike :word) ORDER BY name LIMIT 10

CGridView has:

‘columns’=>array(

	array(





                'name'=>'name',


                'value'=>'$data->name'


                


            ), ...

how to tell model to sort by t.name.

regards

Check your row data, if it’s scrambled then you are having the same issue i am. It seems that Yii doesn’t handle joins that well yet.