From a55efe582bb30c57e6da0d228b928bc8ae84d271 Mon Sep 17 00:00:00 2001 From: zhengchanglong Date: Thu, 12 Dec 2019 17:18:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0-=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=BB=84-=E7=8E=A9=E5=AE=B6=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=95=8F=E6=84=9F=E4=BF=A1=E6=81=AF=E5=8A=A0=E5=AF=86=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/MemberController.class.php | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index c57b0849f..6a265b894 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -494,9 +494,9 @@ class MemberController extends ThinkController $this->error('请填写正确的名字'); } - if (!empty($data['idcard']) && !preg_match('/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/', $data['idcard'])) { + /* if (!empty($data['idcard']) && !preg_match('/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/', $data['idcard'])) { $this->error('请输入正确的身份证号码'); - } + }*/ $res = $member->updateInfo($data); if ($res !== false) { @@ -712,6 +712,30 @@ class MemberController extends ThinkController } } + public function changepidcard() + { + if (preg_match('/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/', $_POST['idcard'])) { + //重复判断 + $where['idcard'] = $_POST['idcard']; + /*$user = M('User', 'tab_')->where($where)->field('id,account')->find(); + if ($user) { + $this->ajaxReturn(array("status" => 0, "msg" => "该身份证号码已被" . $user['account'] . "(" . $user['id'] . ")绑定")); + }*/ + + $map['id'] = $_POST['id']; + $pro = M("User", "tab_") + ->where($map) + ->setField('idcard', $_POST['idcard']); + if ($pro !== false) { + $this->ajaxReturn(array("status" => 1, "msg" => "身份证号码修改成功")); + } else { + $this->ajaxReturn(array("status" => 0, "msg" => "身份证号码修改失败")); + } + } else { + $this->ajaxReturn(array("status" => 0, "msg" => "请输入正确的身份证号码")); + } + } + public function denglu($p = 1) { $map['user_id'] = $_REQUEST['id'];