Hi.
It seems to be a bug in 1.1.1
I have this:
$criteria=new CDbCriteria;
$criteria->with('someRelation');
$adp = new ActiveDataProvider('MyModel', array(
'criteria'=>$criteria,
);
/* Widget code with $adp */
It’s ok, SQL runs with join, but when I add condition:
$criteria=new CDbCriteria;
$criteria->with('someRelation');
$criteria->condition = 'someRelation.fieldId = 1';
$adp = new ActiveDataProvider('MyModel', array(
'criteria'=>$criteria,
);
/* Widget code with $adp */
there is no join statement in SQL.
The only way I found is to use
$criteria->join = 'LEFT JOIN someRelation on MyModel.someRelationId = someRelation.id';
Is that bug or I did not understand something?