From f9488320e974afa83882d86f940107600a22c5da Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 9 Dec 2020 14:40:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8D=E7=A7=B0bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PaymentController.class.php | 30 +++++++------------ Application/Payment/View/Payment/edit.html | 8 +++-- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php index de374b0c1..f00575e49 100644 --- a/Application/Payment/Controller/PaymentController.class.php +++ b/Application/Payment/Controller/PaymentController.class.php @@ -692,20 +692,17 @@ class PaymentController extends BaseController $this->error('手机号不能为空'); } - $is_hav = M("payment_member") - ->where("mobile = '{$data['mobile']}'") - ->find(); - - if ($is_hav) { - $this->error('手机号已经存在'); + if(strlen($data['mobile']) < 11) { + $this->error('手机号格式错误'); +// $this->error('手机号格式错误'); } $is_hav = M("payment_member") - ->where("name = '{$data['name']}'") + ->where("mobile = '{$data['mobile']}'") ->find(); if ($is_hav) { - $this->error('名称已经存在'); + $this->error('手机号已经存在'); } $is_success = M("payment_member") @@ -749,11 +746,15 @@ class PaymentController extends BaseController // $this->error('手机号不能为空'); } - if ($data['id'] == 1) { + $hav_mobile = M("payment_member") + ->where("id = '{$data['id']}'") + ->find(); + + if ($data['id'] == 1 && $hav_mobile['mobile']!=$data['mobile']) { $verify = $_REQUEST['verify']; if (!A("Public")->checksafecode($data['mobile'], $verify)) { - $this->ajaxReturn(["error"=>"验证码错误"]); + $this->ajaxReturn(['status'=>0,'msg'=>'验证码错误']); } } @@ -771,15 +772,6 @@ class PaymentController extends BaseController // $this->error('账号不存在'); } - $is_hav = M("payment_member") - ->where("mobile = '{$data['name']}' and id != {$data['id']}") - ->select(); - - if($is_hav) { - $this->ajaxReturn(['status'=>0,'msg'=>'名称重复请验证']); -// $this->error('名称重复请验证'); - } - $is_hav = M("payment_member") ->where("mobile = '{$data['mobile']}' and id != {$data['id']}") ->find(); diff --git a/Application/Payment/View/Payment/edit.html b/Application/Payment/View/Payment/edit.html index c21a77a44..b3544b62a 100644 --- a/Application/Payment/View/Payment/edit.html +++ b/Application/Payment/View/Payment/edit.html @@ -21,6 +21,7 @@ *手机号码: + @@ -68,13 +69,14 @@ var mobile = $("#mobile").val(); var url = "{:U('edit')}"; var data = {id:id,name:name,mobile:mobile}; + var old_mobile = $("#old_mobile").val(); if (is_change == 0) { layer.msg("姓名、电话未做编辑,请编辑后提交"); return; } - if (id != 1) { + if (id != 1||old_mobile==mobile) { publicAjax(url,data,function (data) { layer.msg(data.msg); if (data.status ==1) { @@ -89,7 +91,7 @@ $.ajax({ type:'post', dataType:'json', - data:'phone='+mobile, + data:'phone='+old_mobile, url:'{:U("Public/telsafecode")}', success:function(data) { if (data.status ==1) { @@ -108,6 +110,8 @@ setTimeout(function(){ window.location.href = "{:U('memberList')}"; },2000) + } else { + } }); return;