Commit 3d0495b5 authored by clone's avatar clone

bug

parent 433b1270
...@@ -65,25 +65,21 @@ class HomePageLog extends Basic ...@@ -65,25 +65,21 @@ class HomePageLog extends Basic
$end_time = date("Y-m-d H:i:s", $params["end_time"]); $end_time = date("Y-m-d H:i:s", $params["end_time"]);
$where_["f.create_time"] = array( 'between', array( $start_time, $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 (!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", '手机号有误或者姓名不满两位汉字'); return $this->response("300", '手机号有误或者姓名不满两位汉字');
} }
//$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
$agent_params["phone|name"] = $params["name_or_phone"]; $agent_params["phone|name"] = $params["name_or_phone"];
$agent_field = "id"; $agent_field = "id";
$model = new AAgents(); $model = new AAgents();
$res_a = $model->getAgentsIdsArray($agent_field, $agent_params); $res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
if($res_a){ if ($res_a) {
$where_["f.agent_id"] = ['in',$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 = []; $join = [];
$order = "f.id desc"; $order = "f.id desc";
...@@ -91,14 +87,14 @@ class HomePageLog extends Basic ...@@ -91,14 +87,14 @@ class HomePageLog extends Basic
$result = $this->uPhoneFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, $join, $where_, ""); $result = $this->uPhoneFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, $join, $where_, "");
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$agent_params =[]; $agent_params = [];
$agent_params["a.id"] = $value['agent_id']; $agent_params["a.id"] = $value['agent_id'];
$agent_field = "a.name,a.img,b.store_name"; $agent_field = "a.name,a.img,b.store_name";
$model = new AAgents(); $model = new AAgents();
$res_a = $model->getAgentsInfo($agent_field, $agent_params); $res_a = $model->getAgentsInfo($agent_field, $agent_params);
$result[$key]['name'] =$res_a[0]['name']; $result[$key]['name'] = $res_a[0]['name'];
$result[$key]['img'] =$res_a[0]['img']; $result[$key]['img'] = $res_a[0]['img'];
$result[$key]['store_name']=$res_a[0]['store_name']; $result[$key]['store_name'] = $res_a[0]['store_name'];
} }
...@@ -158,9 +154,9 @@ class HomePageLog extends Basic ...@@ -158,9 +154,9 @@ class HomePageLog extends Basic
} }
if (empty($params['city'])) { if (empty($params['city'])) {
$where_["f.city"] = trim($this->city)? trim($this->city) :'上海市'; $where_["f.city"] = trim($this->city) ? trim($this->city) : '上海市';
} else { } else {
$where_["f.city"] = $params['city']? $params['city'] :'上海市'; $where_["f.city"] = $params['city'] ? $params['city'] : '上海市';
} }
if (!empty($params['disc'])) { if (!empty($params['disc'])) {
...@@ -168,7 +164,7 @@ class HomePageLog extends Basic ...@@ -168,7 +164,7 @@ class HomePageLog extends Basic
} }
if (!empty($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", '手机号有误或者姓名不满两位汉字'); return $this->response("300", '手机号有误或者姓名不满两位汉字');
} }
//$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" ); //$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
...@@ -176,8 +172,8 @@ class HomePageLog extends Basic ...@@ -176,8 +172,8 @@ class HomePageLog extends Basic
$agent_field = "id"; $agent_field = "id";
$model = new AAgents(); $model = new AAgents();
$res_a = $model->getAgentsIdsArray($agent_field, $agent_params); $res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
if($res_a){ if ($res_a) {
$where_["f.agent_id"] = ['in',$res_a]; $where_["f.agent_id"] = [ 'in', $res_a ];
} }
} }
...@@ -185,21 +181,21 @@ class HomePageLog extends Basic ...@@ -185,21 +181,21 @@ class HomePageLog extends Basic
$order = "f.id desc"; $order = "f.id desc";
$result = $this->gHouseFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, $join, $where_, ""); $result = $this->gHouseFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, $join, $where_, "");
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$agent_params =[]; $agent_params = [];
$agent_params["a.id"] = $value['agent_id']; $agent_params["a.id"] = $value['agent_id'];
$agent_field = "a.name,a.img,b.store_name"; $agent_field = "a.name,a.img,b.store_name";
$model = new AAgents(); $model = new AAgents();
$res_a = $model->getAgentsInfo($agent_field, $agent_params); $res_a = $model->getAgentsInfo($agent_field, $agent_params);
$result[$key]['name'] =$res_a[0]['name']; $result[$key]['name'] = $res_a[0]['name'];
$result[$key]['img'] =$res_a[0]['img']; $result[$key]['img'] = $res_a[0]['img'];
$result[$key]['store_name']=$res_a[0]['store_name']; $result[$key]['store_name'] = $res_a[0]['store_name'];
$house_params =[]; $house_params = [];
$house_params["id"] = $value['house_id']; $house_params["id"] = $value['house_id'];
$house_field = "internal_title"; $house_field = "internal_title";
$model = new GHouses(); $model = new GHouses();
$res_a = $model->getHouseInfo($house_field, $house_params); $res_a = $model->getHouseInfo($house_field, $house_params);
$result[$key]['internal_title'] =$res_a[0]['internal_title']; $result[$key]['internal_title'] = $res_a[0]['internal_title'];
} }
$count = $this->gHouseFollowUpModel->getSearchCount($join, $where_); $count = $this->gHouseFollowUpModel->getSearchCount($join, $where_);
......
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