身份证记录

master
zhanglingsheng 5 years ago
parent 6417434c20
commit 0532b58a22

@ -2105,7 +2105,6 @@ class UserController extends BaseController
{ {
C(api('Config/lists')); C(api('Config/lists'));
$user = json_decode(base64_decode(file_get_contents("php://input")), true); $user = json_decode(base64_decode(file_get_contents("php://input")), true);
if (empty($user['user_id']) || empty($user['idcard']) || empty($user['real_name'])) { if (empty($user['user_id']) || empty($user['idcard']) || empty($user['real_name'])) {
$this -> set_message(1066, "fail", "用户数据异常"); $this -> set_message(1066, "fail", "用户数据异常");
@ -2140,23 +2139,22 @@ class UserController extends BaseController
$data['age_status'] = 3; // 未成年 $data['age_status'] = 3; // 未成年
} }
} else { } else {
// $model = M('idcard', 'tab_')->where(['name' => $data['real_name'],'id_card' => $data['idcard']])->find(); $model = M('idcard', 'tab_')->where(['name' => $data['real_name'],'id_card' => $data['idcard']])->find();
// if(!empty($model)) { if(!empty($model)) {
// if($model['status'] == 1) { if($model['status'] == 1) {
// $data['age_status'] = is_adult($data['idcard']) ? 2 : 3; $data['age_status'] = is_adult($data['idcard']) ? 2 : 3;
// } elseif ($model['status'] == 0) { } elseif ($model['status'] == 0) {
// $this -> set_message(1069, "fail", "用户数据不匹配"); $this -> set_message(1069, "fail", "用户数据不匹配");
// } }
// } else { } else {
$re = age_verify($data['idcard'], $data['real_name']); $re = age_verify($data['idcard'], $data['real_name']);
// $arr['name'] = $data['real_name']; $arr['name'] = $data['real_name'];
// $arr['id_card'] = $data['idcard']; $arr['id_card'] = $data['idcard'];
// $arr['user_id'] = $user['user_id']; $arr['user_id'] = $user['user_id'];
// $arr['status'] = ($re == 1 || $re == 2 ) ? 1 : 0; $arr['status'] = ($re == 1 || $re == 2 ) ? 1 : 0;
// $arr['ip'] = get_client_ip(); $arr['ip'] = get_client_ip();
// $arr['create_time'] = time(); $arr['create_time'] = time();
// M('idcard', 'tab_')->data($arr)->add(); M('idcard', 'tab_')->data($arr)->add();
switch ($re) { switch ($re) {
case - 1: case - 1:
@ -2178,7 +2176,7 @@ class UserController extends BaseController
default: default:
} }
// } }
} }
$return = M('User', 'tab_') -> where($map) -> save($data); $return = M('User', 'tab_') -> where($map) -> save($data);

Loading…
Cancel
Save