|
|
|
@ -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']);
|
|
|
|
|