$userid=session('user.id');
$user = M('cuser');
$data = $user->field('projectno')->where(array('id'=>$userid))->select();
$xq = M('project');
$datas = $xq->field('name')->where(array('id'=>$data[0][projectno]))->select();
$this->assign('xq',$datas);
$this->assign('title',$datas[0][name].'物业系统');
thinkphp怎么联合查询?谢谢大神。
$userid=session('user.id');
$user = M('cuser'); $data = $user->join('INNER JOIN project ON cuser.projectno= project.id')->where(array('cuser.id'=>$userid))->select(); $this->assign('title',$datas[0][name].'物业系统');
已经解决 谢谢