Think\Model:relation方法不存在!

浏览:354 发布日期:2017/03/28 分类:求助交流
命名空间应该没有搞错呀,怎么一直报这个错误,麻烦大神们帮忙看下。


PlatformController.class.php
$platform = D('Platform');
$Config = M('Config');
$count = $platform->where($search)->count();
$page_num = $Config->field('article_page')->find(1);
$Page = new \Think\PageAjax($count,$page_num['article_page'],$nowpages);
//获取内容列表
$platform_list = $platform->relation(true)->order($order)->where($search)->limit($Page->firstRow.','.$Page->listRows)->select();
$PageShow = $Page->show();
dump($platform_list);exit;
$this->assign('page',$PageShow);
$this->assign('platform',$platform_list);
$this->display();

------------------------------------------------

PlatformModel.class.php

namespace Model;
use Think\Model\RelationModel;
class PlatformModel extends RelationModel{
protected $_link = array(
'PlatformExecutives'=>array(
'mapping_type' => self::HAS_ONE,
'class_name' =>'PlatformExecutives',
'foreign_key' => 'user_id',
'as_fields' => 'gg_name,gg_zhiwu,gg_pic,gg_intro',
// 定义更多的关联属性
),
);

附件 QQ20170328-090137@2x.png ( 146.18 KB 下载:2 次 )

最佳答案
评论( 相关
后面还有条评论,点击查看>>