/** * 获取内部员工信息列表 * * @param int page 页书,默认1 * @param int num 每页信息数目,默认20 * @param string keyword 搜索关键字信息,可以使人名or手机号, 默认搜索全部信息 * @return array */ public function getAccountList() { #参数检查 $this->params['page'] = F::request('page', self::DEFAULT_PAGE); $this->params['num'] = F::request('num', self::DEFAULT_NUM); $this->params['keyword'] = F::request('keyword', ''); #获取列表信息 $this->userModel = F::load_model('user', array()); $returnData = $this->userModel->getUserListForAdmin($this->params['keyword'], $this->params['page'], $this->params['num']); #获取信息总量 $this->returnData['count'] = $this->userModel->getTotalUserNum($this->params['keyword']); #组装返回信息 foreach ($returnData as $value) { $_registerTime = strtotime($value['regist_time']); $this->returnData['list'][] = array('id' => $value['id'], 'phone_num' => $value['phone_num'], 'user_id' => $value['user_id'], 'regist_time' => $_registerTime > 0 ? date('Y-m-d', $_registerTime) : '2015-05-01', 'email' => $value['email'], 'name' => $value['nickname']); } unset($returnData); F::rest()->show_result($this->returnData); }
/** * 获取评论列表 * * @access public * @param string type * @param int $page * @param int $num * @return array */ public function getList() { $this->checkAccessToken(); $this->params = $this->require_params(array('type')); if ($this->params['type'] == 'event') { $this->require_params(array('eventId')); } $this->params['page'] = F::request('page', 1); $this->params['num'] = F::request('num', 20); switch ($this->params['type']) { case 'event': $this->returnData = $this->commentModel->getListByEvent($this->params['eventId'], $this->params['page'], $this->params['num']); break; default: throw new Exception('未知的type类型', 100); break; } F::rest()->show_result($this->returnData); }
public static function route() { try { $route = explode('/', F::request('r')); if (count($route) == 2) { try { $module = F::load_controller($route[0]); } catch (Exception $e) { F::log()->log_debug($e); if ($e->getCode()) { $rest = F::rest()->show_error($e->getCode(), $e->getMessage()); } else { $rest = F::rest()->show_error(108); } } if (method_exists($module, $route[1])) { try { $module->{$route}[1](); } catch (Exception $e) { F::log()->log_debug($e); if ($e->getCode()) { $rest = F::rest()->show_error($e->getCode(), $e->getMessage()); } else { $rest = F::rest()->show_error(200, $e->getMessage()); } } } else { throw new Exception('Function Not Found'); } } else { throw new Exception('Route error.'); } } catch (Exception $e) { F::log()->log_debug($e); $rest = F::rest()->show_error(108); } }
public function seachRoomByName() { $this->checkAccessToken(); $this->params['name'] = F::request('name', ''); $this->params['page'] = F::request('page', 1); $this->params['num'] = F::request('num', 20); $this->returnData = $this->groupModel->seachGroupRoomListByName($this->params['name'], $this->params['page'], $this->params['num'], $GLOBALS['userId']); F::rest()->show_result($this->returnData); }
/** * 根据项目&房间信息搜索相应联系人信息 * * @access public * @return array */ public function seachUserListByRoomNum() { $this->checkAccessToken(); $this->params = $this->require_params(array('roomNum', 'projectName')); $this->params['page'] = F::request('page', '1'); $this->params['num'] = F::request('num', '10'); $this->returnData = $this->userModel->seachUserListByRoomNum($this->params['roomNum'], $this->params['projectName'], $this->params['page'], $this->params['num'], $GLOBALS['userId']); $this->userLog($GLOBALS['userId'], __CLASS__ . '/' . __FUNCTION__, serialize($this->params)); F::rest()->show_result($this->returnData); }
public function seach() { $this->params['name'] = F::request('name', ''); $this->params['seachType'] = F::request('type', 0); // $this->returnData = $this->params['seachType'] == 0 ? $this->contactModel->seach($this->params['name']) : $this->contactModel->seachAll($this->params['name']); $this->returnData = $this->contactModel->seach($this->params['name']); F::rest()->show_result($this->returnData); }
/** * 获取所有系统创建的和用户profile属性标签列表 * * @access public * @param string deleteTag * @return array */ public function getListByAllSystem() { $this->params['deleteTag'] = F::request('deleteTag', ''); $this->returnData = $this->tagModel->getListByAllSystem(); F::rest()->show_result($this->returnData); }