From 7cbec414db56179e95c14d9a53b2cc1378affd2d Mon Sep 17 00:00:00 2001 From: chenzhi Date: Mon, 2 Dec 2019 18:46:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=818.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Common/Common/function.php | 2 +- .../Controller/UserController.class.php | 48 ++++++++++++------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index 61fab3954..c7d4909d2 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -1198,7 +1198,7 @@ function age_verify($cardno, $name) return 2; } } elseif (isset($date['status']) && $date['status'] != '01') { - return -2; + return $date['status']; } else { return $date; } diff --git a/Application/Mobile/Controller/UserController.class.php b/Application/Mobile/Controller/UserController.class.php index 5d9762076..98dfee58b 100644 --- a/Application/Mobile/Controller/UserController.class.php +++ b/Application/Mobile/Controller/UserController.class.php @@ -1021,23 +1021,39 @@ class UserController extends BaseController if ($status == 0) { $this->ajaxReturn(array('status' => 0, 'info' => '实名认证暂未开启!', 'url' => U('User/userauth'))); } else { - $re =age_verify($_REQUEST['idcard'],$_REQUEST['real_name']); - if ($re == 0) { - $this->ajaxReturn(array('status' => 0, 'info' => '审核失败!', 'url' => U('User/userauth'))); - } - if ($re == -1) { - $this->ajaxReturn(array('status' => 0, 'info' => '短信数量已使用完!', 'url' => U('User/userauth'))); - } - if ($re == -2) { - $this->ajaxReturn(array('status' => 0, 'info' => '连接错误,请检查配置!', 'url' => U('User/userauth'))); - } - - if ($re == 1) { - $resdata = 2;//成年 - } - if ($re == 2) { - $resdata = 3;//未成年 + //PC_REAL_NAME_REGISTER + $ages = M("Config")->where("name = 'PC_REAL_NAME_REGISTER'")->field("status")->find()['status']; + if($ages == 1){ + $re =age_verify($_REQUEST['idcard'],$_REQUEST['real_name']); + if ($re == 0) { + $this->ajaxReturn(array('status' => 0, 'info' => '审核失败!', 'url' => U('User/userauth'))); + } + if ($re == -1) { + $this->ajaxReturn(array('status' => 0, 'info' => '短信数量已使用完!', 'url' => U('User/userauth'))); + } + if ($re == "202") { + $this->ajaxReturn(array('status' => 0, 'info' => '无法验证!【中心中无此身份证记录,军人转业,户口迁移等】', 'url' => U('User/userauth'))); + } + if ($re == "203") { + $this->ajaxReturn(array('status' => 0, 'info' => '异常情况!', 'url' => U('User/userauth'))); + } + if ($re == "204") { + $this->ajaxReturn(array('status' => 0, 'info' => '姓名格式不正确!', 'url' => U('User/userauth'))); + } + if ($re == "205") { + $this->ajaxReturn(array('status' => 0, 'info' => '身份证格式不正确!', 'url' => U('User/userauth'))); + } + if ($re == 1) { + $resdata = 2;//成年 + } + if ($re == 2) { + $resdata = 3;//未成年 + } + }else{ + $re = 2; + $resdata = 2; } + } if ($re > 0) { $model = D('User')->where($map)->save(array('real_name' => $_REQUEST['real_name'], 'idcard' => $_REQUEST['idcard'], 'age_status' => $resdata));