当前位置: 首页>>代码示例>>PHP>>正文


PHP tool::getParams方法代码示例

本文整理汇总了PHP中tool::getParams方法的典型用法代码示例。如果您正苦于以下问题:PHP tool::getParams方法的具体用法?PHP tool::getParams怎么用?PHP tool::getParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tool的用法示例。


在下文中一共展示了tool::getParams方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getList

 public function getList()
 {
     $typeList = array();
     $typeList['catering'] = "餐饮";
     $typeList['variety'] = "便利店";
     $type = tool::getParams('type', '');
     $name = $typeList[$type];
     $searchType = "3";
     $key = isset($_GET['key']) ? trim($_GET['key']) : null;
     //这里是一个坐标值
     $pageNum = isset($_GET['page']) ? trim($_GET['page']) - 1 : 0;
     // $name = "便利店";
     // $key  = "24.459657,118.087648"; //老虎城
     $response = $this->poi->getList($name, $searchType, $key, $pageNum);
     $response = json_decode($response, true);
     if ($response['status'] != 0) {
         $this->send(array('result' => 'fail', 'message' => $response['message']));
     }
     // 返回错误信息.同时记录日志 message
     $list = array();
     $data = $response['results'];
     foreach ($data as $key => $val) {
         $location = $val['location'];
         $item = $value;
         unset($item['location']);
         $item['location'] = $location['lat'] . ',' . $location['lng'];
         $list[$key] = $item;
     }
     $this->send(array('result' => 'success', 'message' => '成功', 'data' => $list));
 }
开发者ID:mustafakarali,项目名称:b2c-1,代码行数:30,代码来源:control.php

示例2: create

 /**
  * 发起团
  * http://localhost/beauty/index.php?m=ruan&c=index&a=create
  */
 public function create()
 {
     $data = tool::getParams("data", '');
     $data['created'] = strtotime(date('Y-m-d H:i:s'));
     $data['orderNum'] = 0;
     $result = parent::save($data);
     echo json_encode(array('code' => '0', 'message' => '成功', 'data' => $result));
 }
开发者ID:mustafakarali,项目名称:b2c-1,代码行数:12,代码来源:control.php

示例3: checkNickname

 /**
  * 用户昵称是否存在
  * http://local.meizai.com/api.php?m=user&a=checknickname&nickname=aaa
  */
 public function checkNickname()
 {
     $nickname = tool::getParams('nickname', '');
     $data = $this->dao->select("*")->from(TABLE_USER)->where('nickname')->eq($nickname)->fetch();
     if ($data) {
         $this->send(array('result' => 'fail', 'message' => '昵称已经存在'));
     }
     $this->send(array('result' => 'success', 'message' => '昵称不存在'));
 }
开发者ID:mustafakarali,项目名称:b2c-1,代码行数:13,代码来源:checknickname.php

示例4: login

 function login($account = "", $password = "")
 {
     if (!$account) {
         $account = tool::getParams('phone', '');
     }
     $password = tool::getParams('password', '');
     if (!$account || !$password) {
         $this->send(array('result' => 'fail', 'message' => '手机号或密码不能为空'));
     }
     $user = $this->identify($account, $password);
     a($user);
     exit;
     if (!$user) {
         $this->send(array('result' => 'fail', 'message' => '手机号或密码错误'));
     }
     $this->send(array('result' => 'success', 'message' => $this->lang->getSuccess, 'data' => $user));
 }
开发者ID:mustafakarali,项目名称:b2c-1,代码行数:17,代码来源:meizai.user.php

示例5: apiLogin

 /**
  * 查询团详情
  * http://local.meizai.com/api.php?m=user&a=apilogin&account=18250813004&password=123456
  */
 public function apiLogin($account = '', $password = '')
 {
     /* If the user logon already, goto the pre page. */
     if ($this->user->isLogon()) {
         $this->send(array('result' => 'fail', 'message' => '您已经登陆'));
     }
     /* If the user sumbit post, check the user and then authorize him. */
     if (!empty($_POST) || !empty($_GET)) {
         if (!$account) {
             $account = tool::getParams('phone', '');
         }
         $password = tool::getParams('password', '');
         if (!$this->user->login($account, $password)) {
             $this->send(array('result' => 'fail', 'message' => '手机号或密码错误'));
         }
         $this->send(array('result' => 'success', 'message' => '登陆成功', 'data' => $this->app->user));
     }
     $this->send(array('result' => 'fail', 'message' => '获取不到用户名和密码'));
 }
开发者ID:mustafakarali,项目名称:b2c-1,代码行数:23,代码来源:apilogin.php


注:本文中的tool::getParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。