Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
36e41edc
Commit
36e41edc
authored
Feb 22, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
隐私号码
parent
3ab2ec4c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
13 deletions
+56
-13
config.php
application/api_broker/config.php
+4
-1
CellPhone.php
application/api_broker/controller/CellPhone.php
+27
-7
PlsDemo.php
application/api_broker/untils/PlsDemo.php
+9
-5
BindingPhone.php
application/model/BindingPhone.php
+16
-0
No files found.
application/api_broker/config.php
View file @
36e41edc
...
@@ -3,9 +3,11 @@
...
@@ -3,9 +3,11 @@
error_reporting
(
E_ERROR
|
E_PARSE
);
error_reporting
(
E_ERROR
|
E_PARSE
);
define
(
'_MESSAGE_TYPE'
,
'SecretReport'
);
define
(
'_MESSAGE_TYPE'
,
'SecretReport'
);
define
(
'_QUEUE_NAME'
,
'Alicom-Queue-1186048444498461-SecretReport'
);
define
(
'_QUEUE_NAME'
,
'Alicom-Queue-1186048444498461-SecretReport'
);
define
(
'_EXPIRATION'
,
18
00
);
define
(
'_EXPIRATION'
,
5184
00
);
return
[
return
[
'jwt_key'
=>
'tonglian+123'
,
'jwt_key'
=>
'tonglian+123'
,
// 应用模式状态
// 应用模式状态
'app_status'
=>
'dev-config'
,
'app_status'
=>
'dev-config'
,
'_DefaultPoolKey'
=>
'FC100000022056027'
,
'tonglianshangyePoolKey'
=>
'FC100000027622039'
];
];
\ No newline at end of file
application/api_broker/controller/CellPhone.php
View file @
36e41edc
...
@@ -8,16 +8,17 @@
...
@@ -8,16 +8,17 @@
namespace
app\api_broker\controller
;
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\untils\MsgDemo
;
use
app\api_broker\untils\PlsDemo
;
use
app\api_broker\untils\PlsDemo
;
use
app\model\BindingPhone
;
use
think\Config
;
use
think\Db
;
class
CellPhone
extends
Basic
class
CellPhone
extends
Basic
{
{
protected
$code
=
200
;
protected
$code
=
200
;
protected
$data
;
protected
$data
;
protected
$msg
;
protected
$msg
=
""
;
/**
/**
* 绑定手机号
* 绑定手机号
...
@@ -28,16 +29,30 @@ class CellPhone extends Basic
...
@@ -28,16 +29,30 @@ class CellPhone extends Basic
public
function
bindAXB
()
{
public
function
bindAXB
()
{
$params
=
$this
->
request
->
param
();
$params
=
$this
->
request
->
param
();
if
(
$params
[
'phone_a'
]
||
$params
[
'phone_b'
])
{
if
(
$params
[
'phone_a'
]
||
$params
[
'phone_b'
])
{
$result
=
PlsDemo
::
bindAxb
(
$this
->
params
[
'phone_a'
],
$this
->
params
[
'phone_b'
],
_EXPIRATION
,
$params
[
'record'
]);
$expiration
=
date
(
'Y-m-d H:i:s'
,
time
()
+
_EXPIRATION
);
//过期时间
if
(
$result
[
'Code'
]
!=
'OK'
)
{
$phone_a
=
$this
->
params
[
'phone_a'
];
//经纪人手机号
$phone_b
=
$this
->
params
[
'phone_b'
];
//客户手机号
$record
=
empty
(
$this
->
params
[
'record'
])
?
false
:
true
;
//是否录音
$result
=
PlsDemo
::
bindAxb
(
$phone_a
,
$phone_b
,
$expiration
,
$record
,
Config
::
get
(
'_DefaultPoolKey'
));
if
(
$result
->
Message
==
'OK'
)
{
Db
::
table
(
'aliyun_binding_phone'
)
->
save
([
'phone_a'
=>
$phone_a
,
'phone_b'
=>
$phone_b
,
'SubsId'
=>
$result
->
SecretBindDTO
->
SubsId
,
'RequestId'
=>
$result
->
RequestId
,
'record'
=>
$record
]);
$this
->
msg
=
'Binding success'
;
}
else
{
$this
->
code
=
101
;
$this
->
code
=
101
;
$this
->
msg
=
'
绑定失败
'
;
$this
->
msg
=
'
Binding failure
'
;
}
}
}
else
{
}
else
{
$this
->
code
=
101
;
$this
->
code
=
101
;
$this
->
msg
=
'phone_a or phone_b is null'
;
$this
->
msg
=
'phone_a or phone_b is null'
;
}
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
return
$this
->
response
(
$this
->
code
,
$this
->
msg
);
}
}
public
function
updateBindAXB
()
{
public
function
updateBindAXB
()
{
...
@@ -48,4 +63,8 @@ class CellPhone extends Basic
...
@@ -48,4 +63,8 @@ class CellPhone extends Basic
return $this->response($this->code, $this->msg,$this->data);*/
return $this->response($this->code, $this->msg,$this->data);*/
}
}
public
function
agentsUnBind
()
{
PlsDemo
::
unbindSubscription
();
}
}
}
\ No newline at end of file
application/api_broker/untils/PlsDemo.php
View file @
36e41edc
...
@@ -69,14 +69,18 @@ class PlsDemo
...
@@ -69,14 +69,18 @@ class PlsDemo
return
static
::
$acsClient
;
return
static
::
$acsClient
;
}
}
/**
/**
* AXB绑定接口
* AXB绑定接口
*
*
* @return stdClass
* @param $phoneA
* @throws ClientException
* @param $phoneB
* @param $time 过期时间
* @param bool $isRecordingEnabled 是否录音
* @param string $poolKey 号码池Key
* @param string $phoneNoX 中间号码
* @return mixed|\SimpleXMLElement
*/
*/
public
static
function
bindAxb
(
$phoneA
,
$phoneB
,
$time
,
$isRecordingEnabled
=
false
,
$poolKey
=
'FC100000022056027'
)
{
public
static
function
bindAxb
(
$phoneA
,
$phoneB
,
$time
,
$isRecordingEnabled
=
false
,
$poolKey
=
'FC100000022056027'
,
$phoneNoX
=
'17091955105'
)
{
//组装请求对象-具体描述见控制台-文档部分内容
//组装请求对象-具体描述见控制台-文档部分内容
$request
=
new
BindAxbRequest
();
$request
=
new
BindAxbRequest
();
...
@@ -91,7 +95,7 @@ class PlsDemo
...
@@ -91,7 +95,7 @@ class PlsDemo
$request
->
setPhoneNoB
(
$phoneB
);
$request
->
setPhoneNoB
(
$phoneB
);
//可选:指定X号码进行绑定
//可选:指定X号码进行绑定
$request
->
setPhoneNoX
(
"17091955105"
);
$request
->
setPhoneNoX
(
$phoneNoX
);
//可选:期望分配X号码归属的地市(省去地市后缀后的城市名称)
//可选:期望分配X号码归属的地市(省去地市后缀后的城市名称)
$request
->
setExpectCity
(
"北京"
);
$request
->
setExpectCity
(
"北京"
);
...
...
application/model/BindingPhone.php
0 → 100644
View file @
36e41edc
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/1/20
* Time: 17:52
*/
namespace
app\model
;
class
BindingPhone
extends
BaseModel
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'aliyun_binding_phone'
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment