Commit d200ed19 authored by hujun's avatar hujun

agent_id

parent ac4c66f2
...@@ -208,6 +208,11 @@ class HomePageLog extends Basic ...@@ -208,6 +208,11 @@ class HomePageLog extends Basic
$where_["a.store_id"] = $params["store_id"]; $where_["a.store_id"] = $params["store_id"];
} }
//经纪人id
if (!empty($params["agent_id"]) && !empty($params["agent_id"])) {
$where_["a.agent_id"] = $params["agent_id"];
}
if (!empty($params["name_or_phone"])) { if (!empty($params["name_or_phone"])) {
if ((preg_match("/^1\d{10}$/", $params['name_or_phone']) == 1)) { if ((preg_match("/^1\d{10}$/", $params['name_or_phone']) == 1)) {
$agent_params["phone"] = array( "eq", trim($params["name_or_phone"]) ); $agent_params["phone"] = array( "eq", trim($params["name_or_phone"]) );
......
...@@ -67,17 +67,9 @@ class Remark extends Basic ...@@ -67,17 +67,9 @@ class Remark extends Basic
$where['content'] = ['LIKE', "%{$this->params['content']}%"]; $where['content'] = ['LIKE', "%{$this->params['content']}%"];
} }
//跟进人名字 //跟进人id
if (!empty($this->params['remark_name'])) { if (!empty($this->params['agent_id'])) {
if (mb_strlen($this->params['remark_name']) < 2) { $agent_where['id'] = $this->params['agent_id'];
return $this->response(101, '名字长度不足2位');
}
$agent_where['name'] = ['LIKE', '%' . $this->params['remark_name'] . '%'];
}
//跟进人手机号
if (!empty($this->params['remark_phone'])) {
$agent_where['phone'] = $this->params['remark_phone'];
} }
//跟进人门店 //跟进人门店
...@@ -112,17 +104,13 @@ class Remark extends Basic ...@@ -112,17 +104,13 @@ class Remark extends Basic
if (!empty($agent_where)) { if (!empty($agent_where)) {
$m_agent = new AAgents(); $m_agent = new AAgents();
$agent_id_arr = $m_agent->getAgentById('id', $agent_where); $agent_id = $m_agent->getAgentsByWhere($agent_where, 'id');
if (empty($agent_id_arr)) { if (empty($agent_id)) {
$data['data']['list'] = []; $data['data']['list'] = [];
return $this->response(200, '', $data); //处理经纪人空数据 return $this->response(200, '', $data); //处理经纪人空数据
} else { } else {
$agent_id = []; $where['agent_id'] = $agent_id;
foreach ($agent_id_arr as $K => $v) {
$agent_id[] = $v['id'];
}
$where['agent_id'] = ['in', $agent_id];
} }
} }
$field = 'id,user_id,create_time,content,user_status,labels_id,agent_id as f_agent_id'; $field = 'id,user_id,create_time,content,user_status,labels_id,agent_id as f_agent_id';
......
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