Commit abe53d8a authored by clone's avatar clone

Merge branch 'test' of https://gitee.com/zwyjjc/tl_estate into test

parents 2fd4675e 93cfb990
...@@ -67,7 +67,7 @@ class CallPhoneService ...@@ -67,7 +67,7 @@ class CallPhoneService
* @param int $house_id * @param int $house_id
* @return mixed * @return mixed
*/ */
public function bindAXB($phone_a, $phone_b, $record = true, int $user_id, int $agent_id, string $agent_name, int $landlord, int $house_id) public function bindAXB($phone_a, $phone_b, $record = true, int $user_id, $agent_id, string $agent_name, int $landlord, int $house_id)
{ {
$result['status'] = 'failed'; $result['status'] = 'failed';
...@@ -264,15 +264,16 @@ class CallPhoneService ...@@ -264,15 +264,16 @@ class CallPhoneService
/*容联云*/ /*容联云*/
$mappingId = $phone->getSubsId($this->phone_x, $this->phone_a, $this->phone_b, 1, 'mappingId'); $mappingId = $phone->getSubsId($this->phone_x, $this->phone_a, $this->phone_b, 1, 'mappingId');
$yun_tong_xun = new RongDemo(); $yun_tong_xun = new RongDemo();
if ($mappingId) {
if ($mappingId) {
$result = $yun_tong_xun->releaseNumber($mappingId);/*解绑*/ $result = $yun_tong_xun->releaseNumber($mappingId);/*解绑*/
if ($result['statusCode'] == '000000') { if ($result['statusCode'] == '000000') {
$phone->unBind($this->phone_x, $this->phone_a, $this->phone_b); $phone->unBind($this->phone_x, $this->phone_a, $this->phone_b);
} else { } else {
$data['status'] = 'failed'; $yun_result = $yun_tong_xun->getBindInfo($this->phone_a, $this->phone_b, $this->phone_x, $mappingId);
$data['msg'] = '解除失败,如果需要继续与客户沟通,请联系运营!'; if (empty($yun_result['data']['mappingId'])) {
$phone->unBind($this->phone_x, $this->phone_a, $this->phone_b);
}
} }
} else { } else {
$data['msg'] = '没有号码绑定关系,请忽略!。'; $data['msg'] = '没有号码绑定关系,请忽略!。';
......
...@@ -224,4 +224,33 @@ class RongDemo ...@@ -224,4 +224,33 @@ class RongDemo
} }
return $msg; return $msg;
} }
/**
* 检查AXB绑定状态
*
* @param $aNumber
* @param $bNumber
* @param $xNumber
* @param $mappingId
* @return mixed
*/
public function getBindInfo($aNumber, $bNumber, $xNumber, $mappingId)
{
$data = $this->components;
$time = date('YmdHis', time());
$sign = $this->sigParameter($time); /*签名*/
$url = $this->url('axb', 'query', 'cu01', $sign);/*url*/
$Authorization = $this->Authorization($time);/*认证信息*/
$post_data = [
'appId' => $data['appId'],
'mappingId' => $mappingId,
'aNumber' => $aNumber,
'xNumber' => $xNumber,
'bNumber' => $bNumber
];
$result = json_decode($this->sendCurl($url, $post_data, $Authorization), true);
$result['code_msg'] = $this->getCodeString($result['statusCode']);
return $result;
}
} }
\ No newline at end of file
...@@ -85,7 +85,8 @@ class PerformanceService ...@@ -85,7 +85,8 @@ class PerformanceService
"; ";
$order = "performance_total desc"; $order = "performance_total desc";
$result = $this->totalModel->getTotalByAgentId($field, $where_, $type, $order); $result = $this->totalModel->getTotalByAgentIdForPcPerformance($field, $where_, $type, $order,$pageSize,$pageNo);
$total_result = $this->totalModel->getTotalByAgentIdForPcPerformanceTotal($field, $where_, $type);
$arr = []; $arr = [];
$field = "a.name,a.img,b.store_name,c.district_name"; $field = "a.name,a.img,b.store_name,c.district_name";
...@@ -144,7 +145,7 @@ class PerformanceService ...@@ -144,7 +145,7 @@ class PerformanceService
} }
} }
//dump($arr);exit; //dump($arr);exit;
return ['list'=>$arr,'total'=>0]; return ['list'=>$arr,'total'=>$total_result];
} }
......
...@@ -18,9 +18,9 @@ class BindingPhone extends BaseModel ...@@ -18,9 +18,9 @@ class BindingPhone extends BaseModel
* *
* @param $phone_x * @param $phone_x
* @param $phone_a * @param $phone_a
* @param $phone_b * @param string $phone_b
* @param $phoneId
* @param int $status * @param int $status
* @param string $phoneId
* @return bool|mixed * @return bool|mixed
*/ */
public function getSubsId($phone_x, $phone_a, $phone_b = '', $status = 0, $phoneId = 'subsId') public function getSubsId($phone_x, $phone_a, $phone_b = '', $status = 0, $phoneId = 'subsId')
......
...@@ -183,4 +183,67 @@ class TAgentTotalModel extends Model ...@@ -183,4 +183,67 @@ class TAgentTotalModel extends Model
->where($param) ->where($param)
->select(); ->select();
} }
/**
* 获取分组统计数据-pc后台业绩用
* @param $field
* @param $params
* @param $type
* @param string $order
* @return false|\PDOStatement|string|\think\Collection
*/
public function getTotalByAgentIdForPcPerformance($field ,$params, $type ,$order = "",$pageSize,$pageNo)
{
$group_ = "";
switch ($type) {
case 1:
$group_ = "agent_id";
break;
case 2:
$group_ = "store_id";
break;
case 3:
$group_ = "district_id";
break;
}
$result = $this->db_
->field($field)
->where($params)
->group($group_)
->order($order)
->limit($pageSize)
->page($pageNo)
->select();
//echo $this->db_->getLastSql();
return $result;
}
public function getTotalByAgentIdForPcPerformanceTotal($field ,$params, $type ,$order = "")
{
$group_ = "";
switch ($type) {
case 1:
$group_ = "agent_id";
break;
case 2:
$group_ = "store_id";
break;
case 3:
$group_ = "district_id";
break;
}
$result = $this->db_
->field($field)
->where($params)
->group($group_)
->count();
//echo $this->db_->getLastSql();
return $result;
}
} }
\ No newline at end of file
...@@ -167,6 +167,11 @@ class PrivacyNumber ...@@ -167,6 +167,11 @@ class PrivacyNumber
$bind->unBind($v['phone_x'], $v['phone_a'], $v['phone_b']); $bind->unBind($v['phone_x'], $v['phone_a'], $v['phone_b']);
$binding_phone_id[$k] = $v['id']; $binding_phone_id[$k] = $v['id'];
$phone_id[$k] = $v['aliYun_phone_id']; $phone_id[$k] = $v['aliYun_phone_id'];
} else {
$yun_result = $tong_xun->getBindInfo($v['phone_a'], $v['phone_b'], $v['phone_x'], $v['mappingId']);
if (empty($yun_result['data']['mappingId'])) {
$bind->unBind($v['phone_x'], $v['phone_a'], $v['phone_b']);
}
} }
} }
} }
......
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