|
|
@@ -2609,7 +2609,6 @@ class User extends BaseController
|
|
2609
|
2609
|
makeLock()->lock();
|
|
2610
|
2610
|
Db::startTrans();
|
|
2611
|
2611
|
try {
|
|
2612
|
|
- $user_data = Db::name("user")->where(['uid' => $uid])->find();
|
|
2613
|
2612
|
if ($type == 1) {
|
|
2614
|
2613
|
$user_extract_openid = Db::name('user_extract_openid')->where('uid', $uid)->find();
|
|
2615
|
2614
|
if (!empty($user_extract_openid)) {
|
|
|
@@ -2654,22 +2653,8 @@ class User extends BaseController
|
|
2654
|
2653
|
if ($type == 1) {
|
|
2655
|
2654
|
$data = ["wechat_user_id" => $openid];
|
|
2656
|
2655
|
$unionId = $openid;
|
|
2657
|
|
- $check = Db::name('user_extract_openid')->where('openid',$openid)->value('uid');
|
|
2658
|
|
- if (!empty($check) && $check != $uid){
|
|
2659
|
|
- throw new \Exception("此微信号已被其他用户绑定");
|
|
2660
|
|
- }
|
|
2661
|
2656
|
$check = Db::name('user_extract_openid')->where('uid',$uid)->value('openid');
|
|
2662
|
|
- if (!empty($check)){
|
|
2663
|
|
- if ($check != $openid) {
|
|
2664
|
|
- throw new \Exception("您已绑定其他微信号");
|
|
2665
|
|
- }
|
|
2666
|
|
- } else {
|
|
2667
|
|
- Db::name("user_extract_openid")->insert([
|
|
2668
|
|
- 'uid' => $uid,
|
|
2669
|
|
- 'openid' => $openid,
|
|
2670
|
|
- 'type' => $type
|
|
2671
|
|
- ]);
|
|
2672
|
|
- }
|
|
|
2657
|
+ if ($check) throw new \Exception("此微信号已被绑定");
|
|
2673
|
2658
|
} else {
|
|
2674
|
2659
|
$alinfo = json_decode($alinfo, true);
|
|
2675
|
2660
|
if (!$alinfo) throw new \Exception("参数异常");
|