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 $_li
'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 次 )
最佳答案