namespace Home\Model;
use Think\Model\RelationModel;
class ArticleModel extends RelationModel{
protected $_link = array(
'article_detial' =>array(
'mapping_type'=>BELONGS_TO,
'mapping_name'=>'article_detial',
'class_name'=>'article_detial',
'foreign_key'=>'art_id',
'mapping_fields'=>'de_id,vit_num,art_title,art_des,content,href_pic,source',
),
); Index.class.php $article =D('Article');
$result = $article->relation(true)->select();
dump($result);我试过了,用D方法 还是new ArticleModel('Article');都提示是relation错误,求助大虾解救
最佳答案