Commit 037333b3 authored by zhuwei's avatar zhuwei

优化

parent ff8c366d
...@@ -68,35 +68,14 @@ class User extends Basic ...@@ -68,35 +68,14 @@ class User extends Basic
public function searchUser() public function searchUser()
{ {
$params = $this->params; $params = $this->params;
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
//app_request_source_type 1:代表全部客户 //app_request_source_type 1:代表全部客户
$app_request_source_type = !empty($params["app_request_source_type"]) ? $params["app_request_source_type"] : 0; $app_request_source_type = !empty($params["app_request_source_type"]) ? $params["app_request_source_type"] : 0;
/*$params = array(
"user_status" => 0,//客户状态(0:求租;1:已租;-1:无效)
"yetai" => "休闲娱乐",
"area_start" => 1,//面积起始范围 room_area2
"area_end" => 65,//面积结束范围
"money_start" => 1,//租金 price2
"money_end" => 10000,//租金
"start_time" => "2016-05-25",
"end_time" => "2018-05-30",
"id" => 1,
"user_name" => "12312",
"user_phone" => "138171212",
"pageNo" => 1,
"agent_id" => 5741,//传经纪人id代表我得客户
"pageSize" => 15,
"status" => 0,
);*/
$field = "id as user_id,sex,user_name,city,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand,vip,user_label,source_intro";
$conditions = []; $conditions = [];
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
//$conditions["city"] = trim($this->city) ? trim($this->city) : '上海市';
if (isset($params['user_status'])) { if (isset($params['user_status'])) {
$conditions['user_status'] = $params['user_status']; $conditions['user_status'] = $params['user_status'];
} }
...@@ -159,25 +138,20 @@ class User extends Basic ...@@ -159,25 +138,20 @@ class User extends Basic
//是我的客户就显示全部 //是我的客户就显示全部
}else{ }else{
if($app_request_source_type == 1){ if($app_request_source_type == 1){
//'全部客户列表' 需要排除排除纯房东客户 #全部客户列表 排除排除纯房东客户
$conditions['user_label'] = array( "neq", 2 ); $conditions['user_label'] = array( "neq", 2 );
if(!$is_search){ #根据时间搜索,要能搜到保护期客户
//1.全部客户列表、非精确搜索 需要排除排除保护期内的客户 if(!$is_search && !isset($conditions['create_time'])){
$time_now = date('Y-m-d H:i:s');//当前时间 #排除排除保护期内的客户 将截止日期大于当前时间的数据排除掉
//protect_time 将截止日期大于当前时间的数据排除掉 $time_now = date('Y-m-d H:i:s');
$conditions['protect_time'] = array('lt',$time_now); $conditions['protect_time'] = array('lt',$time_now);
$conditions['site_ids'] = [ 'LIKE', '%' . $this->siteId . '%' ];//默认显示经纪人所在站点的客户
} }
#默认显示经纪人所在站点的客户
$conditions['site_ids'] = [ 'LIKE', '%' . $this->siteId . '%' ];
} }
} }
$field = "id as user_id,sex,user_name,city,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand,vip,user_label,source_intro";
/*if (!$is_search) {
$conditions['user_label'] = array( "neq", 2 );
}*/
//dump($conditions);
$userList = $this->userModel->selectUserList($field, $conditions, $pageNo, $pageSize, "id desc"); $userList = $this->userModel->selectUserList($field, $conditions, $pageNo, $pageSize, "id desc");
if (empty($userList)) { if (empty($userList)) {
return $this->response("200", "此条件没有找到数据"); return $this->response("200", "此条件没有找到数据");
......
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