Many to many and has many won’t work with a simple with statement (not sure about together) but if it doesn’t work you have to do something like $criteria->join to set the join statement to get what you want.
public function relations() {
return array(
'rCity' => array(self::BELONGS_TO, 'City', 'CityId')
);
}
without the rCity.City in the select, it’s producing:
SELECT `t`.`Street` AS `t0_c3`, `t`.`Number`
AS `t0_c4`, `t`.`ZipCode` AS `t0_c6`, `t`.`IdDaytrip` AS `t0_c0`,
`rCity`.`IdCity` AS `t1_c0`, `rCity`.`CountryId` AS `t1_c1`,
`rCity`.`Province` AS `t1_c2`, `rCity`.`Municipality` AS `t1_c3`,
`rCity`.`City` AS `t1_c4`, `rCity`.`Deeplink` AS `t1_c5`,
`rCity`.`Latitude` AS `t1_c6`, `rCity`.`Longitude` AS `t1_c7`,
`rCity`.`GoogleMatch` AS `t1_c8` FROM `Daytrips` `t` LEFT OUTER JOIN
`Cities` `rCity` ON (`t`.`CityId`=`rCity`.`IdCity`) WHERE (`t`.`IdDaytrip`
IS NULL