Searching Multiple Unrelated Active Records

Hi All,

I need to search multiple unrelated active records in my site. The search also includes date comparision.

I have easily achieved search queries for single model but have no idea on how to achieve this with multiple models.

Anyone have tried similar extension, please do give a heads up.

Thanks.

You can use JOIN to add two or more models or tables.

eg.-


$Criteria = new CDbCriteria;

$Criteria->join = 'LEFT JOIN table2 ON table2.test_id = table.id';

+1