<?php
class GeneticModel Extends RelationModel{
public function index(){
protected $_li
'Vuser' =>array(
'mapping_type'=>HAS_MANY,
'class_name'=>'Vuser',
'mapping_name'=>'Vuser',
'foreign_key'=>'gasp',
),
);
}
}
?>
查询语句如下:
function find4(){
$res = D('Genetic');
$gid = $this->_post('gid');
$data=$res->relation(true)->where('$gid=5')->select();
}
错误提示:
syntax error, unexpected T_PROTECTED D:\www\ysjk\Admin\Lib\Model\GeneticModel.class.php 第 4 行.
开始还出现过打不到relation方法的错误,也不知道怎么整整就没那提示了
还有就是查询后的结果没有关联表vr的数据,只有g表的数据
最佳答案