[OE-2746] updated referral queries to use CDbCriteria