Commit b6bd6add authored by hujun's avatar hujun

回调缓存

parent af20efcb
......@@ -96,8 +96,10 @@ class PrivacyNumber
$save_data_arr = $save_data = [];
foreach ($post_data as $k => $v) {
$save_data = $v;
$save_data['report_id'] = $v['id'];
unset($save_data['id']); //阿里大于返回是的id改为report_id
if (isset($v['id'])) {
$save_data['report_id'] = $v['id'];
unset($save_data['id']); //阿里大于返回是的id改为report_id
}
$info = $this->redis->get($v['phone_no'].'_'.$v['secret_no'].'_'.$v['peer_no'].'_1');
if (empty($info)) {
......@@ -131,10 +133,19 @@ class PrivacyNumber
$save_data['time'] = $call_time;
if ($call_time > 0) {
$end_date = date('Y-m-d H:i:s', time());
$start_date = date('Y-m-d H:i:s', strtotime("-1 day"));
$num = $this->m_secret_report->getCallNumber($post_data[0]['phone_no'], $post_data[0]['peer_no'], $start_date, $end_date);
$key = 'call_back_'.$v['phone_no'].'_'.$v['peer_no'].'_'.date('Y-m-d', strtotime('-1 day'));
$time = $this->redis->get($key);
if (empty($time)) {
$end_date = date('Y-m-d H:i:s', time());
$start_date = date('Y-m-d H:i:s', strtotime("-1 day"));
$num = $this->m_secret_report->getCallNumber($post_data[0]['phone_no'], $post_data[0]['peer_no'], $start_date, $end_date);
} else {
$num = 1;
}
if (empty($num)) {
$expiration_time = strtotime(date('23:59:59')) - time();
$this->redis->set($key, time(), $expiration_time);
$m_service = new ClientService();
$m_service->saveCallNumByUserId($save_data['users_id']);
}
......
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