Bladeren bron

fix(auth): 修复用户认证状态判断逻辑
- 添加默认值设置 $is_ertification = 1
- 修正认证状态查询逻辑,确保正确返回认证状态

shichen 4 maanden geleden
bovenliggende
commit
37677d5920
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      app/controller/api/Auth.php

+ 3 - 2
app/controller/api/Auth.php

@@ -774,8 +774,9 @@ class Auth extends BaseController
774
         $data["is_merchant"]=$is_merchant===0||$is_merchant>0?$is_merchant:-1;
774
         $data["is_merchant"]=$is_merchant===0||$is_merchant>0?$is_merchant:-1;
775
         $data['phone1'] =substr($data['phone'], 0, 3) . '****' . substr($data['phone'], 7, 4);
775
         $data['phone1'] =substr($data['phone'], 0, 3) . '****' . substr($data['phone'], 7, 4);
776
         $data['longtime'] = intval((time()- strtotime($data['create_time'])) / 86400);
776
         $data['longtime'] = intval((time()- strtotime($data['create_time'])) / 86400);
777
-        $is_ertification = Db::name("user_certification")->where("uid", $user["uid"])->where(['status'=>1])->find();
778
-        if (!$is_ertification){
777
+        $ertification = Db::name("user_certification")->where("uid", $user["uid"])->where(['status'=>1])->find();
778
+        $is_ertification = 1;
779
+        if (!$ertification){
779
             $is_ertification = -1;
780
             $is_ertification = -1;
780
         }
781
         }
781
         $data["is_ertification"] = $is_ertification;
782
         $data["is_ertification"] = $is_ertification;