Commit 908f91d5 authored by hujun's avatar hujun

判断

parent 382b39fe
...@@ -51,8 +51,10 @@ class Client extends Basic ...@@ -51,8 +51,10 @@ class Client extends Basic
$this->params['user_name'] = $this->params['user_nick']; $this->params['user_name'] = $this->params['user_nick'];
} }
$data = [];
if (!empty($this->params['user_name']) || !empty($this->params['id'])) { if (!empty($this->params['user_name']) || !empty($this->params['id'])) {
$data = [];
if ($this->request->isPost()) { if ($this->request->isPost()) {
if (!empty($this->params['id'])) { if (!empty($this->params['id'])) {
...@@ -67,10 +69,8 @@ class Client extends Basic ...@@ -67,10 +69,8 @@ class Client extends Basic
$remark = '修改为'.$agent_data['name'].'-'.$agent_data['phone']; $remark = '修改为'.$agent_data['name'].'-'.$agent_data['phone'];
$push = new PushMessageService(); $push = new PushMessageService();
//A修改了刘小姐(Id:0822)的客方
$ccr_agent_data = $agent->getAgentInfo('name,phone', $this->params['ccr_id']); $ccr_agent_data = $agent->getAgentInfo('name,phone', $this->params['ccr_id']);
$content = "【{$ccr_agent_data['name']}-{$ccr_agent_data['phone']}修改了{$user_agent_id['user_name']}(id:{$user_agent_id['id']})客方】"; $content = "【{$ccr_agent_data['name']}-{$ccr_agent_data['phone']}修改了{$user_agent_id['user_name']}(id:{$user_agent_id['id']})客方】";
// $content = "【你的客户客方被修改为{$agent_data['name']}-{$agent_data['phone']}】";
$push->pushMessageById($user_agent_id['agent_id'], '客方修改', $content, 'user_info', $user_agent_id['id']); $push->pushMessageById($user_agent_id['agent_id'], '客方修改', $content, 'user_info', $user_agent_id['id']);
$this->operating_records($this->params['ccr_id'], $type=3, $remark,0,$this->params['id']); $this->operating_records($this->params['ccr_id'], $type=3, $remark,0,$this->params['id']);
} }
...@@ -85,11 +85,18 @@ class Client extends Basic ...@@ -85,11 +85,18 @@ class Client extends Basic
$agent_data = $table->getAgentInfo('name,phone',$this->params['agents_id']); $agent_data = $table->getAgentInfo('name,phone',$this->params['agents_id']);
$remark = '新增为'. $agent_data['name'].'-'.$agent_data['phone']; $remark = '新增为'. $agent_data['name'].'-'.$agent_data['phone'];
$this->operating_records($this->params['ccr_id'], $type=3, $remark,0,$data['id']); $this->operating_records($this->params['ccr_id'], $type=3, $remark,0,$data['id']);
} else {
$this->code = 101;
$this->msg = '该用户已存在';
} }
} }
if ($data['start'] == -1) {
$this->code = 101;
$this->msg = '该用户已存在';
}
if ($data['start'] == -2) {
$this->code = 101;
$this->msg = '此号码为虚拟号码';
}
} else { } else {
$data['start'] = $this->user->getClient($this->params['id']); $data['start'] = $this->user->getClient($this->params['id']);
} }
...@@ -97,7 +104,7 @@ class Client extends Basic ...@@ -97,7 +104,7 @@ class Client extends Basic
$this->code = 101; $this->code = 101;
$this->msg = 'user_name or id is null'; $this->msg = 'user_name or id is null';
} }
return $this->response($this->code, $this->msg,$data); return $this->response($this->code, $this->msg, $data);
} }
......
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