如何添加第三个关系到我的关系()函数以加入CommentsPosts
模型与store
模型。 Where CommentsPosts.store_id = Store.id
and CommentsPosts.store_zip = Store.zip
?Yii不同模型之间的多重关系
public function relations()
{
return array(
'user' => array(self::BELONGS_TO, $this->module->userModelClass, 'userId'),
'posts' => array(self::HAS_MANY, "CommentsPosts", array("commentId" => "id")),
'store'=>'',
);
}
CommentsPost.php
是modules/comments/model
和Store.php是modules/store/model
通知你,我使用Yii 1.1.15
当我想你可以添加在店面模式 – vijaykumar 2014-12-03 03:55:04