diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index aa45e178b..9166e73c7 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -3,6 +3,7 @@ namespace Admin\Controller; use Sdk\Controller\AgeController; +use Think\Log; use User\Api\MemberApi as MemberApi; use Org\WeixinSDK\Weixin; @@ -937,11 +938,31 @@ class MemberController extends ThinkController } } + + public function changeprelname() + { + if (preg_match('/^([\xe4-\xe9][\x80-\xbf]{2}){2,4}$/', $_POST['real_name'])) { + //重复判断 + $map['id'] = $_POST['id']; + $pro = M("User", "tab_") + ->where($map) + ->setField('real_name', $_POST['real_name']); + 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 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']; + //$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'] . ")绑定")); diff --git a/Application/Admin/View/Member/edit.html b/Application/Admin/View/Member/edit.html index 62dd12e68..2bae45352 100644 --- a/Application/Admin/View/Member/edit.html +++ b/Application/Admin/View/Member/edit.html @@ -99,19 +99,21 @@ 未成年 意外数据 - - - 需玩家认证真实姓名和身份证号码 - + 需玩家认证真实姓名和身份证号码 真实姓名 - + - + + + + + + 点击修改 @@ -366,6 +368,41 @@ }); }); + $("#relname").click(function () { + layer.prompt({ + formType: 3, + title: "请输入真实姓名", + value: '' + }, function (real_name) { + var jsid = $('#selfid').val(); + var realName = /^[\u4E00-\u9FA5]{2,4}$/; + if(!realName.test(real_name)){ + layer.msg("真实姓名填写有误"); + return false; + } + $.ajax({ + url: '{:U("changeprelname")}', + type: 'post', + dataType: 'json', + data: {real_name:real_name,id:jsid}, + success: function (data) { + if (data.status > 0) { + layer.msg(data.msg); + setTimeout(function(){ + self.location.reload(true); + },1500); + + } else { + layer.msg(data.msg) + } + }, + error: function () { + alert("服务器故障!"); + } + }); + }); + }); + $("#idcard").click(function () { layer.prompt({ formType: 3,