Commit faa0efb7 authored by jianghaiming's avatar jianghaiming

update:Set

parent 0674f903
...@@ -20,5 +20,6 @@ class UserException extends BaseException ...@@ -20,5 +20,6 @@ class UserException extends BaseException
6 => '解密失败 不存在', 6 => '解密失败 不存在',
7 => '手机号获取失败', 7 => '手机号获取失败',
8 => '绑定手机号失败', 8 => '绑定手机号失败',
9 => '该手机号已绑定其他用户不能重复绑定',
]; ];
} }
\ No newline at end of file
...@@ -117,6 +117,9 @@ class UserService ...@@ -117,6 +117,9 @@ class UserService
//解密 //解密
$decryptData = []; $decryptData = [];
$wXBizDataCrypt = new WxBizDataCrypt($appid, $sessionKey); $wXBizDataCrypt = new WxBizDataCrypt($appid, $sessionKey);
...@@ -136,6 +139,12 @@ class UserService ...@@ -136,6 +139,12 @@ class UserService
$phoneNumber = strval($decryptData['phoneNumber']); $phoneNumber = strval($decryptData['phoneNumber']);
//判断是否已
$user = UserWechatBind::getRecord(['phone' => $phoneNumber]);
if (!empty($user) && $openid != $user['openid']) {
throw new UserException(['cus' => 9]);
}
$jwUser = (new JwUser ())->getUserInfo(['mobile' => $phoneNumber]); $jwUser = (new JwUser ())->getUserInfo(['mobile' => $phoneNumber]);
$userId = ''; $userId = '';
if (!empty($jwUser['data'])) { if (!empty($jwUser['data'])) {
...@@ -155,7 +164,7 @@ class UserService ...@@ -155,7 +164,7 @@ class UserService
} }
$userInfo['user_id'] = $userId; $userInfo['user_id'] = $userId;
$userInfo['phone'] = $phoneNumber; $userInfo['phone'] = $phoneNumber;
$userInfo['is_pop_up'] = 1; $userInfo['is_pop_up'] = !empty($user) ? 0 : 1;
$userInfo['pop_up_text'] = ""; $userInfo['pop_up_text'] = "";
return $userInfo; return $userInfo;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment