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


PHP UserApi::checkMobile方法代码示例

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


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

示例1: checkbindmobile

 function checkbindmobile()
 {
     $mobile = $_GET['mobile'];
     if ($mobile == null or !is_numeric($mobile)) {
         $data['success'] = false;
         $data['info'] = "请提供手机号码!";
         $this->ajaxReturn($data);
     }
     $User = new UserApi();
     $ret = $User->checkMobile($mobile);
     if ($ret == 1) {
         $data['success'] = true;
         $data['exist'] = false;
     } else {
         $data['success'] = true;
         $data['exist'] = true;
     }
     $this->ajaxReturn($data);
 }
开发者ID:rainly123,项目名称:zyzm,代码行数:19,代码来源:WeixinController.class.php

示例2: validate

 public function validate()
 {
     if (!C('USER_ALLOW_REGISTER')) {
         $this->ajaxErr(-1, '注册已关闭');
     }
     $type = I('type', 'default');
     $value = I('val', '');
     $ok = rand(0, 3) > 1 ? true : false;
     $User = new UserApi();
     $msgMap = array("-1" => "用户名长度不合法", "-2" => "用户名禁止注册", "-3" => "用户名被占用", "-4" => "密码长度不合法", "-5" => "邮箱格式不正确", "-6" => "邮箱长度不合法", "-7" => "邮箱禁止注册", "-8" => "邮箱被占用", "-9" => "手机格式不正确", "-10" => "手机禁止注册", "-11" => "手机号被占用");
     switch ($type) {
         case 'default':
             $this->ajaxErr(-1, '参数错误');
             break;
         case 'username':
             $ret = $User->checkUsername($value);
             if ($ret == 1) {
                 $this->ajaxSucc();
             } else {
                 $this->ajaxErr($ret, $msgMap[$ret]);
             }
             break;
         case 'mobile':
             $ret = $User->checkMobile($value);
             if ($ret == 1) {
                 $this->ajaxSucc();
             } else {
                 $this->ajaxErr($ret, $msgMap[$ret]);
             }
             break;
         case 'email':
             $ret = $User->checkEmail($value);
             if ($ret == 1) {
                 $this->ajaxSucc();
             } else {
                 $this->ajaxErr($ret, $msgMap[$ret]);
             }
             break;
     }
 }
开发者ID:norain2050,项目名称:fk,代码行数:40,代码来源:UserController.class.php

示例3: order

 public function order()
 {
     if (IS_POST) {
         $Order = D('Order');
         $order_id = 'NS' . date('YmdHis') . mt_rand(1000, 9999);
         $uid = is_login();
         if ($uid) {
             $result = $Order->input($order_id, $uid, 1);
         } else {
             $mobile = I('mobile', '', 'trim');
             /* 调用注册接口注册用户 */
             $User = new UserApi();
             $res = $User->checkMobile($mobile);
             if ($res == 1) {
                 $password = mt_rand(100000, 999999);
                 $uid = $User->register('', $password, '', $mobile);
                 if (0 < $uid) {
                     //注册成功
                     send_sms($mobile, '您的密码:' . $password);
                     $result = $Order->input($order_id, $uid, 1);
                 }
             } else {
                 $user_info = $User->getinfo($mobile, 3);
                 $result = $Order->input($order_id, $user_info[0], 1);
             }
         }
         if ($result) {
             $this->redirect('checkOrder', array('order_id' => $order_id));
         } else {
             $this->error('订单提交失败');
         }
     } else {
         $line_id = I('line_id', 0, 'intval');
         $tc_id = I('type_id', 0, 'intval');
         $date = I('date', 0, 'strtotime');
         if (empty($line_id) || empty($tc_id) || empty($date)) {
             $this->error('无效参数');
         }
         // 线路信息
         $line_info = M('Line')->find($line_id);
         // 套餐信息
         $map = array('line_id' => $line_id, 'end_time' => array('egt', strtotime('+' . $line_info['earlier_date'] . 'day')));
         $line_tc = M('LineTc')->where($map)->select();
         if (empty($line_tc)) {
             $this->error('没有报价方案');
         }
         $tc_info = array();
         foreach ($line_tc as $key => $value) {
             if ($value['tc_id'] == $tc_id) {
                 $tc_info = $value;
                 break;
             }
         }
         $ext_time = strtotime('+' . $line_info['earlier_date'] . 'day');
         $tc_str = explode(',', $tc_info['date_price_data']);
         foreach ($tc_str as $value) {
             list($k, $val) = explode('|', $value);
             $k = strtotime($k);
             if ($k <= $ext_time) {
                 continue;
             }
             if ($k == $date) {
                 $tc_info['price_info'] = explode('-', $val);
                 $tc_info['price_info'][] = date('Y-m-d', $k);
                 break;
             }
         }
         if (empty($tc_info['price_info'])) {
             $this->error('没有价格');
         }
         $this->assign('line_info', $line_info);
         $this->assign('line_tc', $line_tc);
         $this->assign('tc_info', $tc_info);
         $this->display();
     }
 }
开发者ID:lampge,项目名称:youweihui,代码行数:76,代码来源:LineController.class.php

示例4: checkMobile

 public function checkMobile($mobile)
 {
     $User = new UserApi();
     $res = $User->checkMobile($mobile);
     if ($res == 1) {
         $this->success('true');
     } else {
         $this->error('false');
     }
 }
开发者ID:bjjfsd,项目名称:youweihui,代码行数:10,代码来源:UserController.class.php

示例5: checkMobile

 public function checkMobile()
 {
     if (IS_POST) {
         $name = I('post.name');
         $param = I('post.param');
         if ($name == 'mobile') {
             $User = new UserApi();
             $ret = $User->checkMobile($param);
             if ($ret == 1) {
                 $this->error('该手机号码不存在');
                 return;
             }
         }
     }
 }
开发者ID:rainly123,项目名称:zyzm,代码行数:15,代码来源:UserController.class.php


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