Browse Source

实名认证验证

zhangxiaobin 1 year ago
parent
commit
c59f1dd56e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      application/api/controller/User.php

+ 6 - 0
application/api/controller/User.php

@@ -929,6 +929,12 @@ class User extends Api
             if (empty($idCard)) {
                 throw new Exception('请输入身份证号');
             }
+            $userAuthWhere['user_id'] = ['neq',$this->auth->id];
+            $userAuthWhere['idcard'] = $idCard;
+            $userAuth = model('UserAuth')->where($userAuthWhere)->find();
+            if (!empty($userAuth)) {
+                throw new Exception('该身份证号已被其他用户实名验证过');
+            }
             /*$userService = new UserService();
             $faceParams = [
                 'real_name' => $realName,