关于spLinker的问题

#1 huangyang0924

2个model
class topic extends spModel{
        public $pk = "tid"; // 每个留言唯一的标志,可以称为主键
        public $table = "topics"; // 数据表的名称
        var $linker=array(
                array(
                        "type"=>"hasone",
                        "map"=>"t_uname",
                        "mapkey"=>"uid",
                        "fclass"=>"user",
                        "fkey"=>"uid",
                        "enabled"=>true
                )
        );
}



class user extends spModel{
        public $pk = "uid";
        public $table = "users";
}



控制器中的action为
$topic=spClass("topic");
               
$fid=$this->spArgs("fid");
$conditions=array("fid"=>$fid);
               
dump($topic->spLinker()->findall($conditions));



查询结果里为何没有 users表中的字段
Array
(
    [0] => Array
        (
            [tid] => 1
            [fid] => 2
            [uid] => 1
            [title] => 标题1
            [content] => 内容1
        )

    [1] => Array
        (
            [tid] => 2
            [fid] => 2
            [uid] => 1
            [title] => 标题2
            [content] => 内容什么
内容啊
        )

    [2] => Array
        (
            [tid] => 6
            [fid] => 2
            [uid] => 2
            [title] => 发新帖
            [content] => 神马东西啊
啊吧才
        )

)

2010-12-17 14:58:01

#2 jake

把这行
dump($topic->spLinker()->findall($conditions));
改成
dump($topic->spLinker()->findAll($conditions));

2010-12-17 15:06:14

#3 huangyang0924

把这行
dump($topic->spLinker()->findall($conditions));
改成
dump($topic->spLinker()->findAll($condit ...
jake 发表于 2010-12-17 15:06
饿。。天哪。。惭愧惭愧。。竟然是这种低级错误。。。早知道试一下find()就知道是findAll拼错了- -||

2010-12-17 15:23:30