关联模型无法关联,求大牛指点哪里出错了

浏览:544 发布日期:2013/09/28 分类:求助交流 关键字: 关联模型
class newsModel extends RelationModel{
    protected $_auto = array(
    array('post_time','time',1,'function'),
    );

    protected $_link = array(
        'newscolumn'=> array(
            'mapping_type'=>HAS_MANY,
            'mapping_name'=>'cid',
            'foreigh_key'=>'cid',
            'mapping_field'=>'name',
            'as_fields'=>'col',
            ),
        );
}
    public function manage(){
        $news = D('news');
        $news = $news->Relation(ture)->select();
        print_r($news);

    }
我news表里面有cid字段想关联newscolumn表里面的cid(是主键),上面代码不能成功,只有news表的信息出来了。
最佳答案
评论( 相关
后面还有条评论,点击查看>>