Commit 9f44a6b8 authored by hujun's avatar hujun

号码占完,优化

parent 54a2155c
...@@ -410,18 +410,28 @@ class CallPhoneService ...@@ -410,18 +410,28 @@ class CallPhoneService
$where['a.status'] = 1; $where['a.status'] = 1;
$where['a.phone_a'] = $this->phone_a; $where['a.phone_a'] = $this->phone_a;
$where['a.type'] = $this->is_privacy; $where['a.type'] = $this->is_privacy;
$agent_call = $this->m_bind->getPhoneX('a.id,a.phone_a,a.phone_b,b.phone_x', $where, 'a.id ASC'); $agent_call = $this->m_bind->getBindingPhoneListLimit(1, 100,'a.id,a.phone_a,a.phone_b,b.phone_x', $where);
$result_unbind = $this->agentsUnBindRedis($agent_call['phone_a'], $agent_call['phone_b'], $agent_call['phone_x']);
$data['msg'] = '号码使用完,请联系运营人员。'; $data['msg'] = '号码使用完,请联系运营人员。';
if ($result_unbind['status'] == 'successful') {
$result = PlsDemo::bindAxb($this->phone_a, $this->phone_b, $this->expiry_date, $this->record, '', $this->city);
$data['status'] = 'success';
$data['msg'] = '绑定成功。';
$data['phone'] = $result->SecretBindDTO->SecretNo;
$this->subs_id = $result->SecretBindDTO->SubsId;
$this->request_id = $result->RequestId;
$this->m_bind->unBindTable($agent_call['id']); $is_bind = 0;
//处理经纪人全部点有意向,占用完号码的情况,释放100组号码
foreach ($agent_call['data'] as $k=>$v) {
$result_unbind = $this->agentsUnBindRedis($v['phone_a'], $v['phone_b'], $v['phone_x']); //释放成功一次
if ($result_unbind['status'] == 'successful') {
$is_bind = 1;
$this->m_bind->unBindTable($v['id']);
}
}
if ($is_bind) {
$result = PlsDemo::bindAxb($this->phone_a, $this->phone_b, $this->expiry_date, $this->record, '', $this->city);
if ($result->Code == 'OK') {
$data['status'] = 'success';
$data['msg'] = '绑定成功。';
$data['phone'] = $result->SecretBindDTO->SecretNo;
$this->subs_id = $result->SecretBindDTO->SubsId;
$this->request_id = $result->RequestId;
}
} }
} else { } else {
$data['msg'] = '拨号失败,15秒再试,再无法拨号请联系请联系运营人员!'; $data['msg'] = '拨号失败,15秒再试,再无法拨号请联系请联系运营人员!';
......
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