class Suit extends CActiveRecord
tablename ‘bank_suit’
class Topic extends CActiveRecord
tablename ‘bank_topic’
表suit和topic是多对多的关系。
class TopicBelongSuit extends CActiveRecord
tablename ‘bank_suit_topic’
<?php
class Suit extends CActiveRecord
{
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'topics'=>array(self::MANY_MANY, 'Topic', 'bank_suit_topic(sid,tid)',),
);
}
}
这里不能直接写TopicBelongSuit(sid,tid)?