这是查出来的页面
array(1) { [0] => array(4) { ["id"] => string(1) "1" ["username"] => string(1) "a" ["password"] => string(1) "a" ["good"] => bool(false) } }
这是model代码
<?php
class UserModel extends RelationModel{
public $_link=array(
'good'=>array(
'mapping_type' =>HAS_ONE,
'class_name' =>'good',
'mapping_name'=>'good',
'foeign_key'=>'uid',
'mapping_fileds'=>'title',
),
);
}
?>
这是action代码
<?php
// 本类由系统自动生成,仅供测试用途
class IndexAction extends Action {
public function index(){
$user=new UserModel();
$list=$user->relation(true)->select();
dump($list);
}
}