qifengquan 1 年間 前
コミット
63ffff1a94
1 ファイル変更11 行追加0 行削除
  1. 11 0
      application/api/controller/Common.php

+ 11 - 0
application/api/controller/Common.php

@@ -471,4 +471,15 @@ class Common extends Api
         return $data['access_token'];
     }
 
+    //根据身份证号码获取生日
+
+    function get_birthday($idcard) {
+        if(empty($idcard)) return null;
+        $bir = substr($idcard, 6, 8);
+        $year = (int) substr($bir, 0, 4);
+        $month = (int) substr($bir, 4, 2);
+        $day = (int) substr($bir, 6, 2);
+        return $year . '-' . $month . '-'  . $day;
+}
+
 }