diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 763ca462f..07ad611b5 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -1196,21 +1196,35 @@ class PromoteController extends ThinkController if (empty($promoteId)) { $this->error('参数异常'); } - if (empty($_POST['real_name'])) { - $this->error('真实姓名不能为空'); - } - if (empty($_POST['idcard'])) { - $this->error('身份证号码不能为空'); + + $promote = D('promote')->field('real_name, idcard, mobile_phone')->where(array('id' => $promoteId))->find(); + if (empty($promote)) { + $this->error('参数异常'); } - if(!is_idcard($_POST['idcard'])) { - $this->error('证件号码错误'); + if (empty($promote['real_name']) || $promote['real_name'] != I('post.real_name', '')) { + if (empty($_POST['real_name'])) { + $this->error('真实姓名不能为空'); + } + $save['real_name'] = I('post.real_name', ''); } - if (empty($_POST['mobile_phone'])) { - $this->error('手机号码不能为空'); + if (empty($promote['idcard']) || $promote['idcard'] != I('post.idcard', '')) { + if (empty($_POST['idcard'])) { + $this->error('身份证号码不能为空'); + } + if(!is_idcard($_POST['idcard'])) { + $this->error('证件号码错误'); + } + $save['idcard'] = I('post.idcard', ''); } - $patternPhone = "/^1[3|5|7|8]\\d{9}$/i"; - if(!preg_match($patternPhone, $_POST['mobile_phone'])) { - $this->error("手机号码格式不合法"); + if (empty($promote['mobile_phone']) || $promote['mobile_phone'] != I('post.mobile_phone', '')) { + if (empty($_POST['mobile_phone'])) { + $this->error('手机号码不能为空'); + } + $patternPhone = "/^1[3|5|7|8]\\d{9}$/i"; + if(!preg_match($patternPhone, $_POST['mobile_phone'])) { + $this->error("手机号码格式不合法"); + } + $save['mobile_phone'] = I('post.mobile_phone', ''); } if (empty($_POST['idcarpic'])) { $this->error('身份证证件照不能为空'); @@ -1257,10 +1271,7 @@ class PromoteController extends ThinkController $save['id'] = $promoteId; $save['ver_status'] = 1; - $save['real_name'] = I('post.real_name', ''); - $save['idcard'] = I('post.idcard', ''); $save['idcarpic'] = I('post.idcarpic', ''); - $save['mobile_phone'] = I('post.mobile_phone', ''); $save['address'][] = I('post.s_province', '') . ',' . I('post.s_city', '') . ',' . I('post.s_county', ''); $save['address'][] = I('post.s_address', ''); $save['address'] = json_encode($save['address']); diff --git a/Application/Admin/View/Promote/certification.html b/Application/Admin/View/Promote/certification.html index 033a38efc..477c524da 100644 --- a/Application/Admin/View/Promote/certification.html +++ b/Application/Admin/View/Promote/certification.html @@ -35,6 +35,36 @@ .select2-container--default .select2-selection--single .select2-selection__arrow { height: 30px; } + .tabcon1711 input[type=text]:read-only { + background: #CCCCCC; + } + .tabcon1711 .span-btn { + float: left; + margin-left: 30px; + height: 30px; + line-height: 30px; + color: #fff; + background-color: #3d96c8; + border: 0; + border-radius: 3px; + cursor: pointer; + align-content: center; + padding-left: 10px; + padding-right: 10px; + } + .tabcon1711 .edit-btn { + background-color: #3d96c8; + } + .tabcon1711 .cancel-btn { + background-color: #999; + display: none; + } + .tabcon1711 .edit-btn:hover { + background-color: #589dc8; + } + .tabcon1711 .cancel-btn { + background-color: #ababab; + }