Commit 3d0495b5 authored by clone's avatar clone

bug

parent 433b1270
......@@ -65,25 +65,21 @@ 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];
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";
......@@ -91,14 +87,14 @@ class HomePageLog extends Basic
$result = $this->uPhoneFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, $join, $where_, "");
foreach ($result as $key => $value) {
$agent_params =[];
$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'];
$result[$key]['name'] = $res_a[0]['name'];
$result[$key]['img'] = $res_a[0]['img'];
$result[$key]['store_name'] = $res_a[0]['store_name'];
}
......@@ -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,7 +164,7 @@ 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"]) . "%" );
......@@ -176,8 +172,8 @@ class HomePageLog extends Basic
$agent_field = "id";
$model = new AAgents();
$res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
if($res_a){
$where_["f.agent_id"] = ['in',$res_a];
if ($res_a) {
$where_["f.agent_id"] = [ 'in', $res_a ];
}
}
......@@ -185,21 +181,21 @@ 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 = [];
$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'];
$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 = [];
$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'];
$result[$key]['internal_title'] = $res_a[0]['internal_title'];
}
$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