class ArticleHeadRelationModel extends RelationModel{
protected $tableName='article_head';//指定主数据表的名称
protected $_li
'category'=>array(//附表名称
'mapping_type'=>BELONGS_TO,//关联关系
'foreign_key'=>'cid',//主表在中间表中的字段名称
'mapping_fields'=>'type',//附表中需要列出的字段
'as_fields'=>'type',//提升附表字段到一级
),
);
}
调用如下:
$list=D('ArticleHead')->relation(true)->where($map)->field('id,ti
运行时错误如下:
Model:relation您所请求的方法不存在!
帮忙看看问什么,谢谢!
最佳答案
