Commit 979ff219 authored by hujun's avatar hujun

查询重号

parent 418817b5
...@@ -745,6 +745,16 @@ class AAgents extends BaseModel ...@@ -745,6 +745,16 @@ class AAgents extends BaseModel
return $this->where($where)->value($fields); return $this->where($where)->value($fields);
} }
/**
* @param $where
* @param $fields
* @return mixed
*/
public function getAgentsByWhereColumn($where, $fields)
{
return $this->where($where)->column($fields);
}
/** /**
* @param $where * @param $where
* @param $fields * @param $fields
......
...@@ -73,4 +73,14 @@ class AAgentsPhone extends BaseModel ...@@ -73,4 +73,14 @@ class AAgentsPhone extends BaseModel
{ {
return $this->where($where)->value($fields); return $this->where($where)->value($fields);
} }
/**
* @param $where
* @param $fields
* @return mixed
*/
public function getAgentsByWhereColumn($where, $fields)
{
return $this->where($where)->column($fields);
}
} }
\ No newline at end of file
...@@ -145,6 +145,7 @@ class PrivacyNumber ...@@ -145,6 +145,7 @@ class PrivacyNumber
$m_bind = new BindingPhone(); $m_bind = new BindingPhone();
$m_agent = new AAgents(); $m_agent = new AAgents();
$m_agent_phone = new AAgentsPhone(); $m_agent_phone = new AAgentsPhone();
$m_secret_report = new AliYunSecretReport();
$date = date('Y-m-d') . ' 23:59:59'; $date = date('Y-m-d') . ' 23:59:59';
$fields = 'a.id,aliYun_phone_id,expiry_date,phone_x,phone_a,phone_b,subsId,a.type,a.mappingId'; $fields = 'a.id,aliYun_phone_id,expiry_date,phone_x,phone_a,phone_b,subsId,a.type,a.mappingId';
$where['a.status'] = 1; $where['a.status'] = 1;
...@@ -164,9 +165,9 @@ class PrivacyNumber ...@@ -164,9 +165,9 @@ class PrivacyNumber
$bind = new BindingPhone(); $bind = new BindingPhone();
$redis = RedisExt::getRedis(); $redis = RedisExt::getRedis();
foreach ($bind_data['data'] as $k => $v) { foreach ($bind_data['data'] as $k => $v) {
$agent_id = $m_agent->getAgentsByWhere(['status'=>0, 'phone'=>$v['phone_a']], 'id'); $agent_id = $m_agent->getAgentsByWhereColumn(['status'=>0, 'phone'=>$v['phone_a']], 'id');
if (empty($agent_id)) { if (empty($agent_id)) {
$agent_id = $m_agent_phone->getAgentsByWhere(['status'=>0, 'phone'=>$v['phone_a']], 'agents_id'); $agent_id = $m_agent_phone->getAgentsByWhereColumn(['status'=>0, 'phone'=>$v['phone_a']], 'agents_id');
} }
//解除绑定 //解除绑定
...@@ -182,8 +183,10 @@ class PrivacyNumber ...@@ -182,8 +183,10 @@ class PrivacyNumber
$phone_id[$k] = $v['aliYun_phone_id']; $phone_id[$k] = $v['aliYun_phone_id'];
} }
$call_key = 'call_'.$agent_id.'_'.$v['phone_a'].'_'.$v['phone_b'].'_1'; foreach ($agent_id as $value) {
$redis->del($call_key); $call_key = 'call_'.$value.'_'.$v['phone_a'].'_'.$v['phone_b'].'_1';
$redis->del($call_key);
}
} elseif ($v['type'] == 2 && !empty($v['mappingId'])) { } elseif ($v['type'] == 2 && !empty($v['mappingId'])) {
//释放容联云隐私号码 //释放容联云隐私号码
$tong_xun = new RongDemo(); $tong_xun = new RongDemo();
...@@ -206,8 +209,10 @@ class PrivacyNumber ...@@ -206,8 +209,10 @@ class PrivacyNumber
} }
} }
$call_key = 'call_'.$agent_id.'_'.$v['phone_a'].'_'.$v['phone_b'].'_2'; foreach ($agent_id as $value) {
$redis->del($call_key); $call_key = 'call_'.$value.'_'.$v['phone_a'].'_'.$v['phone_b'].'_2';
$redis->del($call_key);
}
} }
} }
......
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