Browse Source

绑定支付宝取实名信息

zhangxiaobin 1 year ago
parent
commit
c466c396be
1 changed files with 13 additions and 2 deletions
  1. 13 2
      application/api/controller/Withdraw.php

+ 13 - 2
application/api/controller/Withdraw.php

@@ -258,12 +258,23 @@ class Withdraw extends Common
      * 绑定支付宝
      */
     public function bindAlipay() {
-        $realname = $this->request->request('realname');//真实姓名
+        //$realname = $this->request->request('realname');//真实姓名
         $payNo = $this->request->request('pay_no');//支付宝账号
-        $cardNo = $this->request->request('card_no');//身份证号
+        //$cardNo = $this->request->request('card_no');//身份证号
         //$mobile = $this->request->request('mobile'); //手机号
         //$captcha = $this->request->request('captcha'); //验证码
         $userId = $this->auth->id;
+        //姓名和身份证号 取实名认证
+        $userAuthWhere['user_id'] = $userId;
+        $userAuth = model('UserAuth')->where($userAuthWhere)->find();
+        if (empty($userAuth)) {
+            $this->error('请先实名认证');
+        }
+        if ($userAuth['status'] != 1) {
+            $this->error('请先实名认证通过');
+        }
+        $realname = $userAuth['realname'];
+        $cardNo = $userAuth['idcard'];
         if(!$realname || !$payNo || !$cardNo) {
             $this->error("请将信息填写完整");
         }