This commit is contained in:
小鱼开发
2024-06-20 13:35:38 +08:00
parent db448b569b
commit 14d8249372
2 changed files with 14 additions and 2 deletions
+11 -1
View File
@@ -6,6 +6,11 @@ require_once COMMPATH . 'third_party/Ycall/Ycall.php';
class Yx extends Wxapp
{
private $areaCodes = array(
'110000' => '010',
'350000' => '0592',
'430000' => '0731',
);
function __construct($inputs, $app_key)
{
@@ -16,6 +21,7 @@ class Yx extends Wxapp
$this->check_mobile = array();//需要手机号
$this->check_headimg = array();//授权微信信息
$this->load->model("biz/biz_model");
$this->load->model('receiver/receiver_customers_model', 'customers_model');
$this->load->model('receiver/receiver_yx_model');
@@ -39,6 +45,9 @@ class Yx extends Wxapp
if ($json && $json['licheb'] && $json['licheb']['tel']) {
$user_mobile = $json['licheb']['tel'];
}
$biz = $this->biz_model->get(array('id' => $row['biz_id']));
$areaCode = $this->areaCodes[$biz['province_id']];
$redis = &load_cache('redis');
$cache_key = "XZ_LICHEB_MOBILEA_{$user_mobile}_MOBILEB_{$customer_mobile}_{$admin_id}";
$call_mobile = $redis->get($cache_key);
@@ -46,7 +55,8 @@ class Yx extends Wxapp
$seq_id = create_order_no();
$ycall = new Ycall();
$maxBindingTime = 15;//绑定时间
$result = $ycall->ABXbind($user_mobile, $customer_mobile, $seq_id, $maxBindingTime);
//$result = $ycall->ABXbind($user_mobile, $customer_mobile, $seq_id, $maxBindingTime);
$result = $ycall->ABXbind($user_mobile, $customer_mobile, $seq_id, $maxBindingTime, '', '', 1, $areaCode);
if ($result['result'] != '000000') { //绑定失败
debug_log("xz_failed_bind:customer_mobile【{$customer_mobile}", $this->log_file);
debug_log("xz_result:" . json_encode($result, JSON_UNESCAPED_UNICODE), $this->log_file);
+3 -1
View File
@@ -47,7 +47,7 @@ class Ycall
return $result;
}
public function ABXbind($mobileA, $mobileB, $customerData, $maxBindingTime = 0, $middleNumber = '', $callbackUrl = '', $callRec = 1)
public function ABXbind($mobileA, $mobileB, $customerData, $maxBindingTime = 0, $middleNumber = '', $callbackUrl = '', $callRec = 1, $areaCode = '')
{
!$callbackUrl && $callbackUrl = $this->callbackUrl;
$axbBody = new PrivacyAxbBindBody();
@@ -66,6 +66,8 @@ class Ycall
$axbBody->maxBindingTime = $maxBindingTime;
/**设置话单的推送地址*/
$axbBody->callbackUrl = $callbackUrl;
/**设置区号*/
$axbBody->areaCode = $areaCode;
/**设置为平台分配的account*/
$account = $this->account;