Hi,
I have a model
transportation which has defined relation
'route123'=>array(self::BELONGS_TO, 'routedetails','','on'=>'route123.id=t.route_id', 'joinType'=>'inner JOIN','alias'=>'route123' ),
in view
$trans=transportation::model()->findbyattaributes(array('id'=>1));
$route=$trans->route123; //will give error
in sql log the error is
SELECT * FROM `route_details` `route123` WHERE ((route123.id=t.route_id) AND (route123.is_deleted='0'))
so t.route_id is not being resolved!
but if I set the relation to
'route123'=>array(self::BELONGS_TO, 'routedetails','route_id','joinType'=>'inner JOIN','alias'=>'route123' )
$route=$trans->route123; will work so how to fix as the first relation with the on defined ?