فهرست منبع

港澳台信息

lizhen_gitee 10 ماه پیش
والد
کامیت
ffdcdf9f58
1فایلهای تغییر یافته به همراه56 افزوده شده و 0 حذف شده
  1. 56 0
      application/api/controller/Userauth.php

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

@@ -24,7 +24,63 @@ class Userauth extends Api
     protected $noNeedLogin = [];
     protected $noNeedRight = '*';
 
+    //港澳,台,护照 的信息
+    public function passport_info(){
+        $info = Db::name('user_other_confirm')->where('user_id',$this->auth->id)->find();
+        $this->success(1,$info);
+    }
+    //编辑 港澳,台,护照 的信息
+    public function set_passport()
+    {
+        $field_array = [
+            'passport_familyname',
+            'passport_givenname',
+            'passport_no',
+            'passport_enddate',
+            'passport_images',
+
+            'ga_familyname',
+            'ga_givenname',
+            'ga_no',
+            'ga_startdate',
+            'ga_enddate',
+            'ga_juzhu_images',
+            'ga_tongx_images',
+
+            'tw_juzhu_images',
+            'tw_tongx_images',
+        ];
+
+        $data = [];
+        foreach($field_array as $key => $field){
+
+            if(!input('?'.$field)){
+                continue;
+            }
+
+            $newone = input($field);
+
+            $data[$field] = $newone;
+        }
+
+        if(empty($data)){
+            $this->success();
+        }
 
+        $check = Db::name('user_other_confirm')->where('user_id',$this->auth->id)->find();
+        if($check){
+            $data['updatetime'] = time();
+            $update_rs = Db::name('user_other_confirm')->where('user_id',$this->auth->id)->update($data);
+        }else{
+            $data['user_id'] = $this->auth->id;
+            $data['status'] = 0;
+            $data['createtime'] = time();
+            $data['updatetime'] = time();
+            $update_rs = Db::name('user_other_confirm')->insertGetId($data);
+        }
+
+        $this->success();
+    }
 
 
     //实名认证信息