diff --git a/api/controllers/wxapp/licheb/Yx.php b/api/controllers/wxapp/licheb/Yx.php index 43a5ac2d..0d552a19 100644 --- a/api/controllers/wxapp/licheb/Yx.php +++ b/api/controllers/wxapp/licheb/Yx.php @@ -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); diff --git a/common/third_party/Ycall/Ycall.php b/common/third_party/Ycall/Ycall.php index 7c045b22..e142f0a1 100644 --- a/common/third_party/Ycall/Ycall.php +++ b/common/third_party/Ycall/Ycall.php @@ -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;