Kaynağa Gözat

feat(auth): 添加用户实名认证状态检查功能

- 查询用户实名认证状态并设置标识字段
- 未通过认证的用户返回 -1 状态值
- 已通过认证的用户返回 1 状态值
- 将认证状态添加到用户数据中返回
shichen 4 ay önce
ebeveyn
işleme
a3e655b831
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  1. 8 0
      app/controller/api/Auth.php

+ 8 - 0
app/controller/api/Auth.php

@@ -1695,6 +1695,14 @@ class Auth extends BaseController
1695 1695
             return app('json')->fail('手机号未注册,请先注册');
1696 1696
         }
1697 1697
 
1698
+        // 获取实名状态
1699
+        $ertification = Db::name("user_certification")->where("uid", $user["uid"])->where(['status'=>1])->find();
1700
+        $is_ertification = 1;
1701
+        if (!$ertification){
1702
+            $is_ertification = -1;
1703
+        }
1704
+        $user["is_ertification"] = $is_ertification;
1705
+
1698 1706
         // if($this->source=='yhc' && $this->merId){
1699 1707
         //     $where=['mer_id'=>$this->merId,'uid'=>$user->uid];
1700 1708
         //     $count=Db::name('enterprise_user')->where($where)->count();