本文整理汇总了PHP中Encrypt::decryptPhone方法的典型用法代码示例。如果您正苦于以下问题:PHP Encrypt::decryptPhone方法的具体用法?PHP Encrypt::decryptPhone怎么用?PHP Encrypt::decryptPhone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Encrypt
的用法示例。
在下文中一共展示了Encrypt::decryptPhone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GET_phoneAction
/**
* 获取用户真实手机
* GET /user/1/phone
* @method GET_infoAction
* @param integer $id [description]
* @author NewFuture
*/
public function GET_phoneAction($id = 0)
{
$pid = $this->authPrinter();
if (TaskModel::where('use_id', $id)->where('pri_id', $pid)->get('id')) {
$user = UserModel::field('number,phone')->find($id);
$phone = $user ? Encrypt::decryptPhone($user['phone'], $user['number'], $id) : null;
$this->response(1, $phone);
} else {
$this->response(0, '此同学未在此打印过');
}
}
示例2: GET_phoneAction
/**
* 获取用户真实手机
* GET /user/1/phone
* @method GET_infoAction
* @param integer $id [description]
* @author NewFuture
*/
public function GET_phoneAction($id = 0)
{
$id = $this->auth($id);
$user = UserModel::field('number,phone')->find($id);
$phone = $user ? Encrypt::decryptPhone($user['phone'], $user['number'], $id) : null;
$this->response(1, $phone);
}
示例3: getByPhone
/**
* 根据手机获取用户
* @method getByPhone
* @param [type] $phone [description]
* @return [type] [description]
* @author NewFuture
*/
public static function getByPhone($phone)
{
$tail = Encrypt::encryptPhoneTail(substr($phone, -4));
if ($users = self::where('phone', 'LIKE', '%%' . $tail)->select('id,number,phone')) {
foreach ($users as $user) {
if ($phone == Encrypt::decryptPhone($user['phone'], $user['number'], $user['id'])) {
return $user;
}
}
}
}