本文整理汇总了PHP中F::request方法的典型用法代码示例。如果您正苦于以下问题:PHP F::request方法的具体用法?PHP F::request怎么用?PHP F::request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类F
的用法示例。
在下文中一共展示了F::request方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAccountList
/**
* 获取内部员工信息列表
*
* @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);
}
示例2: getList
/**
* 获取评论列表
*
* @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);
}
示例3: route
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);
}
}
示例4: seachRoomByName
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);
}
示例5: seachUserListByRoomNum
/**
* 根据项目&房间信息搜索相应联系人信息
*
* @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);
}
示例6: seach
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);
}
示例7: getListByAllSystem
/**
* 获取所有系统创建的和用户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);
}