Sfoglia il codice sorgente

真人认证流程

lizhen_gitee 1 anno fa
parent
commit
f457db873e

+ 5 - 1
application/api/controller/User.php

@@ -417,7 +417,7 @@ class User extends Api
         //头像,是否需要审核
         if(isset($data['avatar']) && !empty($data['avatar']) && $data['avatar'] != config('avatar_boy') && $data['avatar'] != config('avatar_girl') && $user_audit_switch == 1){
 
-            $check_exist = Db::name('user_audit')->where('user_id',$this->auth->id)->where('type','audio_bio')->where('status',0)->find();
+            $check_exist = Db::name('user_audit')->where('user_id',$this->auth->id)->where('type','avatar')->where('status',0)->find();
             if(!empty($check_exist)){
                 $this->error('信息已提交等待审核,请勿重复提交');
             }
@@ -432,6 +432,10 @@ class User extends Api
                 ];
                 Db::name('user_audit')->insertGetId($bio_data);
 
+                //失去真人认证
+                $data['real_status'] = -1;
+                Db::name('user_auth')->where(['user_id' => $this->auth->id])->delete();
+
                 if(!isset($data['gender'])){
                     $this->error('信息已提交,审核通过后即可正常展示');//正确不弹出,只能用error
                 }

+ 4 - 0
application/api/controller/Userauth.php

@@ -256,6 +256,10 @@ class Userauth extends Api
         if ($this->auth->avatar == config('avatar_boy') || $this->auth->avatar == config('avatar_girl')) {
             $this->error('请先上传真人头像~');
         }
+        $check = Db::name('user_audit')->where('user_id',$this->auth->id)->where('type','avatar')->where('status',0)->find();
+        if(!empty($check)){
+            $this->error('您的头像还在审核中,审核完成在认证吧');
+        }
 
         //获取token
         $token_url = 'https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/access_token?app_id='.config('tencent_yun')['secret_id'].'&secret='.config('tencent_yun')['secret_key'].'&grant_type=client_credential&version=1.0.0';