Price связано с Photo:
Код: Выделить всё
return array(
'photo'=>array(self::HAS_MANY,'Photo','idItem'),
);
Код: Выделить всё
public function scopes(){
return array(
'first'=>array(
'limit'=>1,
),
);
}
Код: Выделить всё
$models=Price::model()->with('photo:first')->findAll($criteria);