sunxbiao 1 год назад
Родитель
Сommit
08d7cf1757
1 измененных файлов с 1 добавлено и 16 удалено
  1. 1 16
      app/controller/api/user/User.php

+ 1 - 16
app/controller/api/user/User.php

@@ -2609,7 +2609,6 @@ class User extends BaseController
2609
         makeLock()->lock();
2609
         makeLock()->lock();
2610
         Db::startTrans();
2610
         Db::startTrans();
2611
         try {
2611
         try {
2612
-            $user_data = Db::name("user")->where(['uid' => $uid])->find();
2613
             if ($type == 1) {
2612
             if ($type == 1) {
2614
                 $user_extract_openid = Db::name('user_extract_openid')->where('uid', $uid)->find();
2613
                 $user_extract_openid = Db::name('user_extract_openid')->where('uid', $uid)->find();
2615
                 if (!empty($user_extract_openid)) {
2614
                 if (!empty($user_extract_openid)) {
@@ -2654,22 +2653,8 @@ class User extends BaseController
2654
             if ($type == 1) {
2653
             if ($type == 1) {
2655
                 $data = ["wechat_user_id" => $openid];
2654
                 $data = ["wechat_user_id" => $openid];
2656
                 $unionId = $openid;
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
                 $check = Db::name('user_extract_openid')->where('uid',$uid)->value('openid');
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
             } else {
2658
             } else {
2674
                 $alinfo = json_decode($alinfo, true);
2659
                 $alinfo = json_decode($alinfo, true);
2675
                 if (!$alinfo) throw new \Exception("参数异常");
2660
                 if (!$alinfo) throw new \Exception("参数异常");