Commit bdf8fd0b authored by hujun's avatar hujun

尝试5次绑定隐私号码

parent 3e2baa1c
......@@ -126,8 +126,8 @@ class CellPhone extends Basic
$record2 = empty($this->params['record']) ? 'true' : 'false'; /* 是否录音(容联云规定string类型)*/
$aliYunPhone = new AliYunPhone();
$phone_x = $aliYunPhone->getAliYunPhone($phone_a, $phone_b, $is_privacy); //获取未绑定隐号
$result = $Rong->setNumber($phone_a, $phone_b, $phone_x['phone_x'], $phone_x['area'], $time, $record2);
$phone_x = $aliYunPhone->getAliYunPhone($phone_a, $phone_b, $is_privacy); //获取未绑定隐号
$result = $Rong->setNumber($phone_a, $phone_b, $phone_x['phone_x'], $phone_x['area'], $time, $record2);
/*绑定成功*/
if ($result['statusCode'] == '000000') {
......@@ -136,8 +136,30 @@ class CellPhone extends Basic
$this->msg = '绑定成功';
$this->data = [ 'phone' => $phone_x['phone_x'] ];
} else {
$phone_x_arr[] = $phone_x['phone_x']; //剔除绑定失败的中间号
//尝试5次再绑定
for ($i = 0; $i < 5; $i++) {
$phone_x = $aliYunPhone->getAliYunPhone($phone_a, $phone_b, $is_privacy, $phone_x_arr); //获取未绑定隐号
$result = $Rong->setNumber($phone_a, $phone_b, $phone_x['phone_x'], $phone_x['area'], $time, $record2);
if ($result['statusCode'] == '000000') {
$aliYunPhone = new AliYunPhone();
$aliYunPhone->editStatus($phone_x, $phone_a, $phone_b, $record, $time, 0, $result['data']['mappingId'], $is_privacy); //记录绑定
$this->msg = '绑定成功';
$this->data = [ 'phone' => $phone_x['phone_x'] ];
return $this->response($this->code, $this->msg, $this->data);
} else {
$phone_x_arr[] = $phone_x['phone_x']; //剔除绑定失败的中间号
}
}
//绑定失败返回错误信息
$this->code = 101;
$this->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