|
|
|
@ -2080,6 +2080,7 @@ class UserController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
C(api('Config/lists'));
|
|
|
|
|
$user = json_decode(base64_decode(file_get_contents("php://input")), true);
|
|
|
|
|
|
|
|
|
|
if (empty($user['user_id']) || empty($user['idcard']) || empty($user['real_name'])) {
|
|
|
|
|
|
|
|
|
|
$this -> set_message(1066, "fail", "用户数据异常");
|
|
|
|
@ -2095,7 +2096,6 @@ class UserController extends BaseController
|
|
|
|
|
$checkidcard = new \Think\Checkidcard();
|
|
|
|
|
$invidcard = $checkidcard -> checkIdentity($data['idcard']);
|
|
|
|
|
if (!$invidcard) {
|
|
|
|
|
|
|
|
|
|
$this -> set_message(1086, "fail", "身份证号码填写不正确!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -2109,14 +2109,15 @@ class UserController extends BaseController
|
|
|
|
|
}
|
|
|
|
|
//身份证认证
|
|
|
|
|
if (C('tool_age.status') == 0) {
|
|
|
|
|
|
|
|
|
|
if (is_adult($data['idcard'])) {
|
|
|
|
|
$data['age_status'] = 2; // 成年
|
|
|
|
|
} else {
|
|
|
|
|
$data['age_status'] = 3; // 未成年
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
if(M('idcard', 'tab_')->where(['name' => $data['real_name'],'id_card' => $data['idcard']])->find()) {
|
|
|
|
|
$data['age_status'] = is_adult($data['idcard']) ? 2 : 3;
|
|
|
|
|
} else {
|
|
|
|
|
$re = age_verify($data['idcard'], $data['real_name']);
|
|
|
|
|
switch ($re) {
|
|
|
|
|
|
|
|
|
@ -2139,6 +2140,12 @@ class UserController extends BaseController
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if($re == 1 || $re == 2) {
|
|
|
|
|
$arr['name'] = $data['real_name'];
|
|
|
|
|
$arr['id_card'] = $data['idcard'];
|
|
|
|
|
M('idcard', 'tab_')->data($arr)->add();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$return = M('User', 'tab_') -> where($map) -> save($data);
|
|
|
|
|