Commit 382b39fe authored by hujun's avatar hujun

隐私号码判断

parent 6b56bb2f
......@@ -332,12 +332,6 @@ class Member extends Basic{
$agent_data = $agent->getAgentInfo('name,phone', $this->params['agents_id']);
$remark = '新增为' . $agent_data['name'] . '-' . $agent_data['phone'];
$result = $this->user->edit($this->params, $this->params['id']); //新增或编辑
if ($result == -1) {
return $this->response(101, '该用户已经存在!');
}
$this->params['id'] = $result;
} else {
$user_data = $this->user->getUserById('id,agent_id', $this->params['id']);
if (empty($user_data)) {
......@@ -351,10 +345,20 @@ class Member extends Basic{
} else {
$remark = '用户编辑';
}
$data['start'] = $this->user->edit($this->params, $this->params['id']); //新增或编辑
$result = $this->user->edit($this->params, $this->params['id']); //新增或编辑
}
}
if ($result == -1) {
$this->code = 101;
$this->msg = '该用户已存在';
}
if ($result == -2) {
$this->code = 101;
$this->msg = '此号码为虚拟号码';
}
$this->operating_records($this->userId, $type=3, $remark, $this->params['id']);
} else {
......@@ -364,7 +368,7 @@ class Member extends Basic{
}
$data['list'] = $this->user->getClient($this->params['id']);
}
return $this->response($this->code, $this->msg,$data);
return $this->response($this->code, $this->msg, $data);
}
......
......@@ -279,11 +279,19 @@ class Users extends Model
//新增
$is_exist = $this->where('user_phone', $data['user_phone'])->count();
if (empty($is_exist)) {
$insert_data['source'] = 20;
$insert_data['status'] = -1;
$insert_data['create_time'] = date('Y-m-d H:i:s');
$this->save($insert_data);
$return_id = $this->id;
$m_phone = new AliYunPhone();
$num = $m_phone->where('phone_x', $data['user_phone'])->count(); //查询隐私号码
if ($num == 0) {
$insert_data['source'] = 20;
$insert_data['status'] = -1;
$insert_data['create_time'] = date('Y-m-d H:i:s');
$this->save($insert_data);
$return_id = $this->id;
} else {
$return_id = -2;
}
} else {
$return_id = -1;
}
......
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