名称bug修改

master
zhengyongxing 4 years ago
parent ec3491943b
commit f9488320e9

@ -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();

@ -21,6 +21,7 @@
<tr>
<td class="l"><i class="mustmark">*</i>手机号码:</td>
<td class="r">
<input id="old_mobile" type="text" class="" placeholder="请输入手机号码" value="{$data['mobile']}" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength=11 style="display: none">
<input name="mobile" id="mobile" type="text" class="" placeholder="请输入手机号码" value="{$data['mobile']}" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength=11>
<!-- <span class="notice-text">制单人登陆用的手机</span>-->
</td>
@ -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;

Loading…
Cancel
Save