Commit 3c7f58b2 authored by zw's avatar zw

控制手机端经纪人刷跟进接口

parent 318b59f4
...@@ -5,6 +5,8 @@ namespace app\api_broker\controller; ...@@ -5,6 +5,8 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic; use app\api_broker\extend\Basic;
use app\api_broker\service\ClientService; use app\api_broker\service\ClientService;
use app\api_broker\service\UserExpiredTimeService; use app\api_broker\service\UserExpiredTimeService;
use app\api_broker\service\VerifyRepetitionService;
use app\extra\RedisExt;
use app\model\AAgents; use app\model\AAgents;
use app\model\GHouses; use app\model\GHouses;
use app\model\GHousesFollowUp; use app\model\GHousesFollowUp;
...@@ -50,6 +52,13 @@ class HomePageLog extends Basic ...@@ -50,6 +52,13 @@ class HomePageLog extends Basic
"pageSize" => 15 "pageSize" => 15
);*/ );*/
$vrs = new VerifyRepetitionService();
$is_check = $vrs->followUpClick($this->agentId);
if(!$is_check){
return $this->response("101", "请勿频繁请求");
}
if (empty($params['start_time']) || empty($params['end_time'])) { if (empty($params['start_time']) || empty($params['end_time'])) {
return $this->response("101", '请选择时间'); return $this->response("101", '请选择时间');
} }
......
...@@ -54,4 +54,26 @@ class VerifyRepetitionService ...@@ -54,4 +54,26 @@ class VerifyRepetitionService
} }
} }
/**
* 控制经纪人点击客户跟进次数
* @param $agent_id
* @return bool
*/
public function followUpClick($agent_id){
if (!$this->redis_) {
return true;
}
$time = 10;
$record_click = $this->redis_->get("record_click_" .$agent_id);
if (!$record_click ) {
$this->redis_->set("record_click_" .$agent_id, 1, $time);
} elseif( $record_click < 3) {
$this->redis_->incr("record_click_" .$agent_id);
}else{
return false;
}
return true;
}
} }
\ No newline at end of file
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