Commit a5fd799c authored by hujun's avatar hujun

// 优化

parent 9dec1ae8
...@@ -16,6 +16,7 @@ use app\api_broker\service\BrokerService; ...@@ -16,6 +16,7 @@ use app\api_broker\service\BrokerService;
use app\api_broker\service\CallPhoneService; use app\api_broker\service\CallPhoneService;
use app\api_broker\service\ClientService; use app\api_broker\service\ClientService;
use app\api_broker\service\OrderLogService; use app\api_broker\service\OrderLogService;
use app\api_broker\service\RedisCacheService;
use app\api_broker\service\VipService; use app\api_broker\service\VipService;
use app\extra\RedisExt; use app\extra\RedisExt;
use app\index\service\UserService; use app\index\service\UserService;
...@@ -394,10 +395,13 @@ class Broker extends Basic ...@@ -394,10 +395,13 @@ class Broker extends Basic
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效 //跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users->update_user_status([ 'id' => $user_id, 'user_status' => $user_status ]); $Users->update_user_status([ 'id' => $user_id, 'user_status' => $user_status ]);
$redis = RedisExt::getRedis(); // $redis = RedisExt::getRedis();
$user_key = 'call_phone_user_' . date('Y-m-d'); // $user_key = 'call_phone_user_' . date('Y-m-d');
$hash_key = $this->agentId . '-' . $params['user_id'].'-'.$this->siteId; // $hash_key = $this->agentId . '-' . $params['user_id'].'-'.$this->siteId;
$redis->hDel($user_key, $hash_key); // $redis->hDel($user_key, $hash_key);
$redis_service = new RedisCacheService();
$redis_service->delRecordCallRedis($this->agentId, $params['user_id'], $this->siteId);
return $this->response("200", "success!", $result); return $this->response("200", "success!", $result);
} else { } else {
return $this->response("101", "失败!"); return $this->response("101", "失败!");
...@@ -441,10 +445,12 @@ class Broker extends Basic ...@@ -441,10 +445,12 @@ class Broker extends Basic
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效 //跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users->update_user_status([ 'id' => $user_id, 'user_status' => $user_status ]); $Users->update_user_status([ 'id' => $user_id, 'user_status' => $user_status ]);
$redis = RedisExt::getRedis(); // $redis = RedisExt::getRedis();
$user_key = 'call_phone_user_' . date('Y-m-d'); // $user_key = 'call_phone_user_' . date('Y-m-d');
$hash_key = $this->agentId . '-' . $params['user_id'].'-'.$this->siteId; // $hash_key = $this->agentId . '-' . $params['user_id'].'-'.$this->siteId;
$redis->hDel($user_key, $hash_key); // $redis->hDel($user_key, $hash_key);
$redis_service = new RedisCacheService();
$redis_service->delRecordCallRedis($this->agentId, $params['user_id'], $this->siteId);
return $this->response("200", "success!", $result); return $this->response("200", "success!", $result);
} else { } else {
return $this->response("101", "失败!"); return $this->response("101", "失败!");
......
...@@ -311,4 +311,19 @@ class RedisCacheService ...@@ -311,4 +311,19 @@ class RedisCacheService
} }
return $result; return $result;
} }
/**
* 删除拨打缓存
*
* @param $agent_id
* @param $user_id
* @param $site_id
* @return mixed
*/
public function delRecordCallRedis($agent_id, $user_id, $site_id)
{
$user_key = 'call_phone_user_' . date('Y-m-d');
$hash_key = $agent_id . '-' . $user_id.'-'.$site_id;
return $this->redis_ext->hDel($user_key, $hash_key);
}
} }
\ No newline at end of file
...@@ -473,10 +473,12 @@ class Member extends Basic{ ...@@ -473,10 +473,12 @@ class Member extends Basic{
$user = new Users(); $user = new Users();
$user->update_user_status(['id'=>$params['user_id'],'user_status'=>$params['user_status']]); $user->update_user_status(['id'=>$params['user_id'],'user_status'=>$params['user_status']]);
$redis = RedisExt::getRedis(); // $redis = RedisExt::getRedis();
$user_key = 'call_phone_user_'.date('Y-m-d'); // $user_key = 'call_phone_user_'.date('Y-m-d');
$hash_key = $this->userId.'-'.$params['user_id']; // $hash_key = $this->userId.'-'.$params['user_id'];
$redis->hDel($user_key, $hash_key); // $redis->hDel($user_key, $hash_key);
$redis_service = new RedisCacheService();
$redis_service->delRecordCallRedis($this->userId, $params['user_id'], $this->siteId);
return $this->response($status, $msg, $params); return $this->response($status, $msg, $params);
} }
......
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