private function _getson($uid){ $sonlists = Db::name('user') ->where(['ruid' => $uid]) ->order('id desc') ->field('id,ruid,top_uid,nickname,telphone') ->select(); if ($sonlists) { foreach ($sonlists as $k => &$v) { $data = $this->_getson($v['id']); if ($data){ $v['children'] = $data; } } } return $sonlists; } public function family() { $info = Db::name('user') ->where(['id' => $_GET['top_uid']]) ->order('id desc') ->field('id,ruid,top_uid,nickname,telphone') ->find(); $info['children'] = $this->_getson($_GET['top_uid']); dump($info); exit; // $this->assign('info', $info); // return $this->fetch(); }