Commit 935f7217 authored by zhuwei's avatar zhuwei

bug

parent a9a23a1d
......@@ -49,12 +49,17 @@ class CollectUser extends Basic
return $this->response("101", "请求参数错误");
}
$is_outstrip_twenty_four_hours = $this->isNewUser($params['user_id']);
if($is_outstrip_twenty_four_hours == 0 ){
return $this->response("101", "客户在保护期内");
}
//先判断是否已经存在数据
$field = 'id,status';
$get_params['agents_id'] = $params["agents_id"];
$get_params['user_id'] = $params["user_id"];
$res = $this->aCollectUser->getCollectUser($field,$get_params);
dump($res);
if($res){//如果存在
if($res[0]['status'] != $params["status"] ){//如果存在-并且状态一致 不作处理 不一致则更新状态
......@@ -67,10 +72,6 @@ class CollectUser extends Basic
$res = true ;
}
}else{//不存在则新增数据
$is_outstrip_twenty_four_hours = $this->isNewUser($params['user_id']);
if($is_outstrip_twenty_four_hours == 0 ){
return $this->response("101", "客户在保护期内");
}
$insert["agents_id"] = $params['agents_id'];
$insert["user_id"] = $params['user_id'];
$insert["status"] = 1;
......@@ -159,6 +160,7 @@ class CollectUser extends Basic
}
$Users = new Users();
$result = $Users->getUserCityInfo($user_id);
dump($result);
if($result){
if((time() - strtotime($result[0]['create_time'])) > (60*60*24)){
$is_outstrip_twenty_four_hours = 1;// 0:保护器内 1:超过保护期
......@@ -166,6 +168,8 @@ class CollectUser extends Basic
$is_outstrip_twenty_four_hours = 0;// 0:保护器内 1:超过保护期
}
}
dump($is_outstrip_twenty_four_hours);
return $is_outstrip_twenty_four_hours;
}
......
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