hi,
I need to pass param to the on in join
$criteria = new CDbCriteria;
$criteria->join = "left join invoices v1 on t.id=v1.s_id and v1.year=:year";
$criteria->params= array(':year'=>$category->year); //will not work
error Invalid parameter number: number of bound variables does not match number of
tokens
or if it could be implemented in my model
public function relations()
{
return array(
'invoices'=>array(self::BELONGS_TO, 'invoices', '', 'on'=>'t.id=invoices.sid and v1.year=:year', 'joinType'=>'left JOIN', 'alias'=>'invoices' ), //how to pass param :year?
how to pass the param in the join in either case ?
Thank you