dever 3 years ago
parent
commit
041ce04af0
2 changed files with 22 additions and 1 deletions
  1. 15 1
      service/option/database/member.php
  2. 7 0
      service/option/src/Auth.php

+ 15 - 1
service/option/database/member.php

@@ -12,7 +12,11 @@ $status = array
     2 => '系统导入',
 );
 
-
+$idcard_bind = array
+(
+    1 => '身份证已绑定',
+    2 => '身份证未绑定',
+);
 
 return array
 (
@@ -124,6 +128,16 @@ return array
             'list'      => true,
         ),
 
+        'idcard_bind'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '身份证是否绑定',
+            'default'   => '2',
+            'desc'      => '身份证是否绑定',
+            'match'     => 'is_numeric',
+            'option'    => $idcard_bind,
+        ),
+
         'status'        => array
         (
             'type'      => 'tinyint-1',

+ 7 - 0
service/option/src/Auth.php

@@ -64,10 +64,17 @@ class Auth
                     if ($user['idcard'] != $idcard) {
                         Dever::alert('身份证号不正确');
                     }
+                    # 验证身份证是否验证过
+                    $find = Dever::db('option/member')->find(array('idcard' => $idcard, 'idcard_bind' => 1));
+                    if ($find) {
+                        Dever::alert('身份证已被绑定');
+                    }
+                    Dever::db('option/member')->update(array('where_id' => $user['id'], 'idcard_bind' => 1));
                 }
 
                 Dever::load('option/lib/account')->checkMcode($mobile);
                 $data = Dever::load('passport/reg')->getSign($account['id']);
+
             }
             if ($account['status'] == 1) {
                 $data['status'] = 1;