Commit 114f801d authored by zhuwei's avatar zhuwei

客户保护器判断

parent 01cda0d3
......@@ -61,7 +61,7 @@ class User extends Basic
public function searchUser()
{
$params = $this->params;
/* $params = array(
/*$params = array(
"user_status" => 0,//客户状态(0:求租;1:已租;-1:无效)
"yetai" => "休闲娱乐",
"area_start" => 1,//面积起始范围 room_area2
......@@ -74,9 +74,9 @@ class User extends Basic
"user_name" => "12312",
"user_phone" => "138171212",
"pageNo" => 1,
//"agent_id" => 5741,//传经纪人id代表我得客户
"agent_id" => 5741,//传经纪人id代表我得客户
"pageSize" => 15,
"status" => -1,
"status" => 0,
);*/
$field = "id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand,vip";
......@@ -131,9 +131,6 @@ class User extends Basic
$start_time = date('Y-m-d H:i:s', $params['start_time']);
$end_time = date('Y-m-d H:i:s', $params['end_time']);
$conditions['create_time'] = array( 'between', array( $start_time, $end_time ) );
} else if (empty($params["agent_id"]) && empty($params["id"]) && empty($params["user_phone"])) {
$time_ = date('Y-m-d H:i:s', strtotime("-1 day"));
$conditions['create_time'] = array( 'lt', $time_ );
}
if (isset($params['status'])) {
......@@ -145,7 +142,6 @@ class User extends Basic
$conditions['agent_id'] = $params['agent_id'];
}
$userList = $this->userModel->selectUserList($field, $conditions, $pageNo, $pageSize, "id desc");
if (empty($userList)) {
return $this->response("200", "此条件没有找到数据");
......@@ -158,6 +154,12 @@ class User extends Basic
foreach ($userList as $k => $v) {
$is_show = $clientService->dialTotal($v["user_id"]);
if ($is_show) {
//判断客户是否超过24小时保护期间 0:保护器内 1:超过保护期
$is_outstrip_twenty_four_hours = 0;
if((time() - strtotime($v['create_time'])) > (60*60*24)){
$is_outstrip_twenty_four_hours = 1;
}
$v['is_outstrip_twenty_four_hours']=$is_outstrip_twenty_four_hours;
array_push($list, $v);
}
}
......
......@@ -572,7 +572,7 @@ class Users extends Model
->page($pageNo)
->limit($pageSize)
->select();
// echo $this->getLastSql();
//echo $this->getLastSql();
return $result;
}
......
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