class ArticleModel extends RelationModel {
protected $tableName='article';
protected $_link=array(
'column' => array(
'mapping_type' => self::BELONGS_TO,
'class_name' => 'Column',
'foreign_key' => 'column_id',
),
);控制器$DB1=new RelationModel('article');
$article=$DB1->relation(true)->find(1);
//$article=$DB1->order('time desc')->select();
dump($article);返回的数据array(6) {
["id"] => string(1) "1"
["title"] => string(7) "测试1"
["content"] => string(169) "测试内容1测试内容1测试内容1测试内容1测试内容1测试内容1测试内容1测试内容1测试内容1测试内容1测试内容1测试内容1测试内容1"
["time"] => string(19) "2015-07-17 17:49:17"
["clicknum"] => string(1) "0"
["column_id"] => string(1) "1"实在没招了,各位帮帮忙 最佳答案