public function get() { $this->checkAccessToken(); $this->params = $this->require_params(array('id')); #检查当前用户是否具有查看该群组权限 if ($this->userModel->isEnableOpen($GLOBALS['userId'], $this->params['id'], 3)) { $this->returnData = $this->groupModel->setGroupId($this->params['id'])->get(); } else { $this->returnData = array(); } F::rest()->show_result($this->returnData); }
/** * 获取联系人的相关信息 * * @access public * @return array */ public function getContactProfile() { $this->checkAccessToken(); $this->params = $this->require_params(array('phoneNum')); $this->params['id'] = F::request('id', 0); if ($this->params['id']) { $userId = $this->params['id']; } else { $userId = $this->userModel->getUserIdByUsername($this->params['phoneNum']); if (!$userId) { throw new Exception('用户不存在', 101); } } #判定查看权限 $openEnable = $this->userModel->isEnableOpen($GLOBALS['userId'], $userId, 1); if ($openEnable) { $this->returnData = $this->contactModel->getContactProfile($userId); } else { $this->returnData = array(); } F::rest()->show_result($this->returnData); }