|
|
|
@ -2115,10 +2115,23 @@ class UserController extends BaseController
|
|
|
|
|
$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 {
|
|
|
|
|
$model = M('idcard', 'tab_')->where(['name' => $data['real_name'],'id_card' => $data['idcard']])->find();
|
|
|
|
|
if(!empty($model)) {
|
|
|
|
|
if($model['status'] == 1) {
|
|
|
|
|
$data['age_status'] = is_adult($data['idcard']) ? 2 : 3;
|
|
|
|
|
} elseif ($model['status'] == 0) {
|
|
|
|
|
$this -> set_message(1069, "fail", "用户数据不匹配");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$re = age_verify($data['idcard'], $data['real_name']);
|
|
|
|
|
$arr['name'] = $data['real_name'];
|
|
|
|
|
$arr['id_card'] = $data['idcard'];
|
|
|
|
|
$arr['user_id'] = $user['user_id'];
|
|
|
|
|
$arr['status'] = ($re == 1 || $re == 2 ) ? 1 : 0;
|
|
|
|
|
$arr['ip'] = get_client_ip();
|
|
|
|
|
$arr['create_time'] = time();
|
|
|
|
|
M('idcard', 'tab_')->data($arr)->add();
|
|
|
|
|
switch ($re) {
|
|
|
|
|
|
|
|
|
|
case - 1:
|
|
|
|
@ -2140,14 +2153,9 @@ 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);
|
|
|
|
|
if ($return === false) {
|
|
|
|
|
$this -> set_message(1070, "fail", "用户数据更新失败");
|
|
|
|
|