Commit 3d0495b5 authored by clone's avatar clone

bug

parent 433b1270
......@@ -39,14 +39,14 @@ class HomePageLog extends Basic
public function userFollowUpList()
{
$params = $this->params;
/*$params = array(
"start_time" => strtotime('2016-08-14 15:47:36'), //开始时间
"end_time" => strtotime('2018-08-14 15:47:36'), //结束时间
"name_or_phone" => "18112347151",//用户姓名或电话 经纪人
"search_content" => "",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
/*$params = array(
"start_time" => strtotime('2016-08-14 15:47:36'), //开始时间
"end_time" => strtotime('2018-08-14 15:47:36'), //结束时间
"name_or_phone" => "18112347151",//用户姓名或电话 经纪人
"search_content" => "",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
if (empty($params['start_time']) || empty($params['end_time'])) {
return $this->response("101", '请选择时间');
......@@ -65,49 +65,45 @@ class HomePageLog extends Basic
$end_time = date("Y-m-d H:i:s", $params["end_time"]);
$where_["f.create_time"] = array( 'between', array( $start_time, $end_time ) );
}
/*if (!empty($params["name_or_phone"])) {
$where_["a.name|a.phone"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
}*/
if (!empty($params["name_or_phone"])) {
if((preg_match("/^1\d{10}$/", $params['name_or_phone']) != 1) or (strlen($params['name_or_phone']) < 6)){
if ((preg_match("/^1\d{10}$/", $params['name_or_phone']) != 1) or (strlen($params['name_or_phone']) < 6)) {
return $this->response("300", '手机号有误或者姓名不满两位汉字');
}
//$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
$agent_params["phone|name"] = $params["name_or_phone"];
$agent_field = "id";
$model = new AAgents();
$res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
if($res_a){
$where_["f.agent_id"] = ['in',$res_a];
$agent_field = "id";
$model = new AAgents();
$res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
if ($res_a) {
$where_["f.agent_id"] = [ 'in', $res_a ];
}
}
$where_["f.city"] = trim($this->city) ? trim($this->city) :'上海市';
$where_["f.city"] = trim($this->city) ? trim($this->city) : '上海市';
$join = [];
$order = "f.id desc";
$join = [];
$order = "f.id desc";
$result = $this->uPhoneFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, $join, $where_, "");
foreach ($result as $key => $value) {
$agent_params =[];
$agent_params["a.id"] = $value['agent_id'];
$agent_field = "a.name,a.img,b.store_name";
$model = new AAgents();
$res_a = $model->getAgentsInfo($agent_field, $agent_params);
$result[$key]['name'] =$res_a[0]['name'];
$result[$key]['img'] =$res_a[0]['img'];
$result[$key]['store_name']=$res_a[0]['store_name'];
$agent_params = [];
$agent_params["a.id"] = $value['agent_id'];
$agent_field = "a.name,a.img,b.store_name";
$model = new AAgents();
$res_a = $model->getAgentsInfo($agent_field, $agent_params);
$result[$key]['name'] = $res_a[0]['name'];
$result[$key]['img'] = $res_a[0]['img'];
$result[$key]['store_name'] = $res_a[0]['store_name'];
}
$count = $this->uPhoneFollowUpModel->getSearchCount($join, $where_);
$count = $this->uPhoneFollowUpModel->getSearchCount($join, $where_);
if (count($result) > 0) {
$list["result"] = $result;
$list["img_path"] = AGENTHEADERIMGURL;
//暂时处理
$list["total"] = $count;
$list["total"] = $count;
return $this->response("200", "request success", $list);
} else {
return $this->response("200", "request null");
......@@ -127,14 +123,14 @@ class HomePageLog extends Basic
{
$params = $this->params;
/*$params = array(
"start_time" => strtotime('2016-08-14 11:02:36'), //开始时间
"end_time" => strtotime('2018-08-14 11:07:10'), //结束时间
"name_or_phone" => "18112347151",//用户姓名或电话
"search_content" => "1",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
/*$params = array(
"start_time" => strtotime('2016-08-14 11:02:36'), //开始时间
"end_time" => strtotime('2018-08-14 11:07:10'), //结束时间
"name_or_phone" => "18112347151",//用户姓名或电话
"search_content" => "1",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
if (empty($params['start_time']) || empty($params['end_time'])) {
return $this->response("101", '请选择时间');
......@@ -158,9 +154,9 @@ class HomePageLog extends Basic
}
if (empty($params['city'])) {
$where_["f.city"] = trim($this->city)? trim($this->city) :'上海市';
$where_["f.city"] = trim($this->city) ? trim($this->city) : '上海市';
} else {
$where_["f.city"] = $params['city']? $params['city'] :'上海市';
$where_["f.city"] = $params['city'] ? $params['city'] : '上海市';
}
if (!empty($params['disc'])) {
......@@ -168,16 +164,16 @@ class HomePageLog extends Basic
}
if (!empty($params["name_or_phone"])) {
if((preg_match("/^1\d{10}$/", $params['name_or_phone']) != 1) or (strlen($params['name_or_phone']) < 6)){
if ((preg_match("/^1\d{10}$/", $params['name_or_phone']) != 1) or (strlen($params['name_or_phone']) < 6)) {
return $this->response("300", '手机号有误或者姓名不满两位汉字');
}
//$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
$agent_params["phone|name"] = $params["name_or_phone"];
$agent_field = "id";
$model = new AAgents();
$res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
if($res_a){
$where_["f.agent_id"] = ['in',$res_a];
$agent_field = "id";
$model = new AAgents();
$res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
if ($res_a) {
$where_["f.agent_id"] = [ 'in', $res_a ];
}
}
......@@ -185,24 +181,24 @@ class HomePageLog extends Basic
$order = "f.id desc";
$result = $this->gHouseFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, $join, $where_, "");
foreach ($result as $key => $value) {
$agent_params =[];
$agent_params["a.id"] = $value['agent_id'];
$agent_field = "a.name,a.img,b.store_name";
$model = new AAgents();
$res_a = $model->getAgentsInfo($agent_field, $agent_params);
$result[$key]['name'] =$res_a[0]['name'];
$result[$key]['img'] =$res_a[0]['img'];
$result[$key]['store_name']=$res_a[0]['store_name'];
$house_params =[];
$house_params["id"] = $value['house_id'];
$house_field = "internal_title";
$model = new GHouses();
$res_a = $model->getHouseInfo($house_field, $house_params);
$result[$key]['internal_title'] =$res_a[0]['internal_title'];
$agent_params = [];
$agent_params["a.id"] = $value['agent_id'];
$agent_field = "a.name,a.img,b.store_name";
$model = new AAgents();
$res_a = $model->getAgentsInfo($agent_field, $agent_params);
$result[$key]['name'] = $res_a[0]['name'];
$result[$key]['img'] = $res_a[0]['img'];
$result[$key]['store_name'] = $res_a[0]['store_name'];
$house_params = [];
$house_params["id"] = $value['house_id'];
$house_field = "internal_title";
$model = new GHouses();
$res_a = $model->getHouseInfo($house_field, $house_params);
$result[$key]['internal_title'] = $res_a[0]['internal_title'];
}
$count = $this->gHouseFollowUpModel->getSearchCount($join, $where_);
$count = $this->gHouseFollowUpModel->getSearchCount($join, $where_);
if (count($result) > 0) {
$list["result"] = $result;
$list["img_path"] = AGENTHEADERIMGURL;
......
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