浏览代码

feat(user): 实名认证同步master代码

shichen 9 月之前
父节点
当前提交
e883f60353
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      app/controller/api/user/User.php

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

@@ -955,7 +955,6 @@ class User extends BaseController
955
         $params['create_time'] = time();
955
         $params['create_time'] = time();
956
         $params['uid'] = $member_id;
956
         $params['uid'] = $member_id;
957
         $baidu = new Ocr();
957
         $baidu = new Ocr();
958
-
959
         // 兼容港澳台证件
958
         // 兼容港澳台证件
960
         if ($cardType != 1) {
959
         if ($cardType != 1) {
961
             // 设置exitentrypermit_type
960
             // 设置exitentrypermit_type
@@ -983,6 +982,7 @@ class User extends BaseController
983
             if ($real_user_card != $params['user_card']) {
982
             if ($real_user_card != $params['user_card']) {
984
                 return app('json')->fail('姓名或身份证号输入有误~');
983
                 return app('json')->fail('姓名或身份证号输入有误~');
985
             }
984
             }
985
+
986
             $params['reason'] = '';
986
             $params['reason'] = '';
987
             $params['audit_time'] = 0;
987
             $params['audit_time'] = 0;
988
             $params['update_time'] = 0;
988
             $params['update_time'] = 0;
@@ -1018,6 +1018,7 @@ class User extends BaseController
1018
             $image = file_get_contents($params['card_positive']);
1018
             $image = file_get_contents($params['card_positive']);
1019
             $idCardSide = "front";
1019
             $idCardSide = "front";
1020
             $result = $baidu->idcard($image, $idCardSide);
1020
             $result = $baidu->idcard($image, $idCardSide);
1021
+            Log::info('hkMacauTaiwan:' . json_encode($result));
1021
             $real_user_name = $result['words_result']['姓名']['words'] ?? '';
1022
             $real_user_name = $result['words_result']['姓名']['words'] ?? '';
1022
             $real_user_card = $result['words_result']['公民身份号码']['words'] ?? '';
1023
             $real_user_card = $result['words_result']['公民身份号码']['words'] ?? '';
1023
             if ($real_user_name != $params['user_name']) {
1024
             if ($real_user_name != $params['user_name']) {
@@ -1028,6 +1029,7 @@ class User extends BaseController
1028
             }
1029
             }
1029
             if ($result['image_status'] == "normal" && $result['idcard_number_type'] == 1) {
1030
             if ($result['image_status'] == "normal" && $result['idcard_number_type'] == 1) {
1030
                 $params['status'] = 1;
1031
                 $params['status'] = 1;
1032
+                $params['card_type'] = $cardType;
1031
                 $res = $this->repository->add_cer($params, $member_id);
1033
                 $res = $this->repository->add_cer($params, $member_id);
1032
                 if ($res) {
1034
                 if ($res) {
1033
                     $userRepository = app()->make(UserRepository::class);
1035
                     $userRepository = app()->make(UserRepository::class);
@@ -1050,6 +1052,7 @@ class User extends BaseController
1050
                 return app('json')->fail('认证失败,请重新认证');
1052
                 return app('json')->fail('认证失败,请重新认证');
1051
             }
1053
             }
1052
         }
1054
         }
1055
+
1053
     }
1056
     }
1054
 
1057
 
1055
 
1058