Commit ffabb5d1 by HTML5-侯张振

修改 个人中心--修改绑定手机号,手机号和验证码输入之后,提示语不对,我现在用的是已经存在的手机号

parent 970ba304
...@@ -202,6 +202,9 @@ class Customer extends CI_Controller { ...@@ -202,6 +202,9 @@ class Customer extends CI_Controller {
//先判断是否可以重新报备 //先判断是否可以重新报备
//1规定时间内,未报备过的 //1规定时间内,未报备过的
$cbInfo = $this->customer_building->is_report($cb_id); //前提未过期 $cbInfo = $this->customer_building->is_report($cb_id); //前提未过期
if (is_array($cbInfo) && !$cbInfo['valid_day']) {
$cbInfo['valid_day'] = 7;
}
if ($cbInfo['report_status'] != 'NEVER' if ($cbInfo['report_status'] != 'NEVER'
|| ||
$time < ($cbInfo['create_time'] + ($cbInfo['valid_day'] - 2) * 24 * 3600) $time < ($cbInfo['create_time'] + ($cbInfo['valid_day'] - 2) * 24 * 3600)
......
...@@ -147,13 +147,27 @@ class Myself extends CI_Controller{ ...@@ -147,13 +147,27 @@ class Myself extends CI_Controller{
$cur_info=array( $cur_info=array(
'user_mobile'=>$post['mobile'] 'user_mobile'=>$post['mobile']
); );
$use=array(
'user_mobile'=>$post['mobile'],
'user_type' => 6
);
$get_user = $this->user->get_use_mobile($use);
$where=array('id'=>$this->user_id); $where=array('id'=>$this->user_id);
$check=$this->user->update($where,$cur_info); if($get_user){
$result=array('errcode'=>42123,'errmsg'=>'输入手机号码已存在');
echo json_encode($result);
return ;
}
$check=$this->user->update($where,$cur_info);
if($check){ if($check){
$this->session->sess_destroy(); $this->session->sess_destroy();
//get 获取请求登录页 //get 获取请求登录页
alert_redirect(site_url('distributor/logindis'),'修改成功'); alert_redirect(site_url('distributor/logindis'),'修改成功');
return ; return;
} }
$result=array('errcode'=>42155,'errmsg'=>'修改失败,请稍候再试'); $result=array('errcode'=>42155,'errmsg'=>'修改失败,请稍候再试');
echo json_encode($result); echo json_encode($result);
......
...@@ -198,4 +198,12 @@ class User_model extends MY_Model{ ...@@ -198,4 +198,12 @@ class User_model extends MY_Model{
} }
return false; return false;
} }
//查询是否有正在使用的手机号
public function get_use_mobile($where){
$this->db->select('*')
->from('tb_user U')
->where($where);
$query = $this->db->get();
return $query->row_array();
}
} }
\ No newline at end of file
...@@ -129,8 +129,8 @@ ...@@ -129,8 +129,8 @@
} }
}, },
error:function(){ error:function(){
alert('修改成功!'); alert('修改失败!');
window.location.href="<?php echo site_url('distributor/logindis') ?>"; // window.location.href="<?php echo site_url('distributor/logindis') ?>";
} }
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment