Browse Source

客户加的代码

lizhen_gitee 1 year ago
parent
commit
b62aaaec26
2 changed files with 21 additions and 2 deletions
  1. 11 2
      application/api/controller/User.php
  2. 10 0
      application/api/controller/Usercenter.php

+ 11 - 2
application/api/controller/User.php

@@ -929,10 +929,19 @@ class User extends Api
             }
             $userAuthWhere['user_id'] = ['neq',$this->auth->id];
             $userAuthWhere['idcard'] = $idCard;
-            $userAuth = model('UserAuth')->where($userAuthWhere)->find();
+
+            // 获取用户已经实名认证的数量
+            $authenticatedCount = model('UserAuth')->where(['idcard' => $idCard])->count();
+
+            // 如果已经实名认证的数量不超过3个
+            if ($authenticatedCount > 3) {
+                throw new Exception('您当前身份证号已经认证过3次');
+            }
+
+            /*$userAuth = model('UserAuth')->where($userAuthWhere)->find();
             if (!empty($userAuth)) {
                 throw new Exception('该身份证号已被其他用户实名验证过');
-            }
+            }*/
             /*$userService = new UserService();
             $faceParams = [
                 'real_name' => $realName,

+ 10 - 0
application/api/controller/Usercenter.php

@@ -702,6 +702,8 @@ class UserCenter extends Common
         $res = $useranchorModel->insertGetId($data);
         if($res) {
             \app\common\model\User::update(["is_anchor"=>1],["id"=>$this->auth->id]);
+            $vbot = new \addons\vbot\Vbot();
+            $vbot->vbotSendMsg('Anchor_Application_Notice', [], []);
             $this->success("申请发送成功!");
         } else {
             $this->error("网络错误,请稍后重试");
@@ -1389,6 +1391,14 @@ class UserCenter extends Common
                 throw new Exception('提现失败');
             }
             Db::commit();
+            $vbot = new \addons\vbot\Vbot();
+            $vbot->vbotSendMsg('Withdrawal_Application_Notice', [], [
+                'name' => $name,
+                'account' => $account,
+                'real_money' => $realMoney,
+                'type' => $typeStr,
+                'handingfee' => $platformMoney
+            ]);
             $this->success('操作成功待审核');
         } catch (Exception $e) {
             Db::rollback();