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
ccd46b0f
Commit
ccd46b0f
authored
Mar 15, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
容联云2.2
parent
8093dd42
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
33 deletions
+56
-33
RongPhone.php
application/api_broker/controller/RongPhone.php
+33
-13
RongDemo.php
application/api_broker/untils/RongDemo.php
+6
-4
common.php
application/common.php
+5
-5
BindingPhone.php
application/model/BindingPhone.php
+3
-1
route.php
application/route.php
+3
-3
PrivacyNumber.php
application/task/controller/PrivacyNumber.php
+6
-7
No files found.
application/api_broker/controller/RongPhone.php
View file @
ccd46b0f
...
...
@@ -4,6 +4,7 @@ namespace app\api_broker\controller;
use
app\api_broker\extend\Basic
;
use
app\api_broker\untils\RongDemo
;
use
app\model\BindingPhone
;
class
RongPhone
extends
Basic
{
...
...
@@ -11,19 +12,38 @@ class RongPhone extends Basic
protected
$data
=
[];
protected
$msg
=
""
;
/**
* 绑定AXB
/**绑定AXB
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
rBindAXB
(){
$bind
=
new
BindingPhone
();
$params
=
$this
->
request
->
param
();
$data
=
array
();
$Rong
=
new
RongDemo
();
$code
=
$Rong
->
statusCode
;
$phone_a
=
$params
[
'phone_a'
];
$phone_b
=
$params
[
'phone_b'
];
/*查询分配的中间号*/
$where
[
'a.status'
]
=
1
;
$where
[
'a.type'
]
=
2
;
$where
[
'a.phone_a'
]
=
$phone_a
;
$where
[
'a.phone_b'
]
=
$phone_b
;
$phone_x
[
'phone_x'
]
=
$bind
->
getPhoneX
(
'phone_x,area'
,
$where
);
var_dump
(
$phone_x
);
exit
;
if
(
!
$phone_x
){
}
$data
=
array
();
$Rong
=
new
RongDemo
();
$code
=
$Rong
->
statusCode
;
$phone_a
=
'18521714341'
;
$phone_x
=
'17080219070'
;
$phone_b
=
'13524893873'
;
$data
[
'data'
]
=
json_decode
(
$Rong
->
setNumber
(
$phone_a
,
$phone_b
,
$phone_x
,
'0755'
),
true
);
$data
[
'msg'
]
=
$code
[
$data
[
'data'
][
'statusCode'
]];
$data
[
'data'
]
=
json_decode
(
$Rong
->
setNumber
(
$phone_a
,
$phone_b
,
$phone_x
[
'phone_x'
],
$phone_x
[
'area'
]),
true
);
$data
[
'msg'
]
=
$code
[
$data
[
'data'
][
'statusCode'
]];
/*绑定成功*/
if
(
$data
[
'data'
][
'statusCode'
]
==
'000000'
){
}
$data2
=
json_encode
(
$data
);
echo
$data2
;
}
...
...
@@ -33,9 +53,9 @@ class RongPhone extends Basic
*/
public
function
rongReleaseNumber
(){
$Rong
=
new
RongDemo
();
$mappingId
=
'NME201201803141740516611729495567817080219070'
;
$r
=
$Rong
->
releaseNumber
(
$
mappingId
);
$params
=
$this
->
request
->
param
();
//
$mappingId = 'NME201201803141740516611729495567817080219070';
$r
=
$Rong
->
releaseNumber
(
$
params
[
'mappingId'
]
);
echo
$r
;
}
...
...
application/api_broker/untils/RongDemo.php
View file @
ccd46b0f
...
...
@@ -143,11 +143,13 @@ class RongDemo
'bNumber'
=>
$bNumber
,
'servingNumber'
=>
$xNumber
,
'areaCode'
=>
$areaCode
,
'callStateNotifyUrl'
=>
"https://pre.tonglianjituan.com/task/addReport"
,
'cdrNotifyUrl'
=>
"https://pre.tonglianjituan.com/task/addReport"
,
'recordNotifyUrl'
=>
"https://pre.tonglianjituan.com/task/addReport"
,
'cdrNotifyUrl'
=>
CURRENT_URL
.
"/task/rongBilledInformUrl"
,
'callStateNotifyUrl'
=>
CURRENT_URL
.
"/task/rongRecordingInformUrl"
,
'recordNotifyUrl'
=>
CURRENT_URL
.
"/task/rongStatusInformUrl"
,
// 'cdrNotifyUrl' =>"http://pre.tonglianjituan.com/task/rongBilledInfromUrl",
// 'callStateNotifyUrl'=>"http://pre.tonglianjituan.com/task/rongRecordingInfromUrl",
// 'recordNotifyUrl'=>"http://pre.tonglianjituan.com/task/rongStatusInfromUrl",
];
$result
=
$this
->
sendCurl
(
$url
,
$post_data
,
$Authorization
);
return
$result
;
...
...
application/common.php
View file @
ccd46b0f
...
...
@@ -121,11 +121,11 @@ function hide_customer_phone($phone)
}
//打印
function
prt
(
$arr
){
echo
"<pre/>"
;
print_r
(
$arr
);
}
//
//
打印
//
function prt($arr){
//
echo "<pre/>";
//
print_r($arr);
//
}
/**^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$
* 验证手机号是否正确
...
...
application/model/BindingPhone.php
View file @
ccd46b0f
...
...
@@ -93,8 +93,9 @@ class BindingPhone extends BaseModel
public
function
getPhoneX
(
$field
,
$where
)
{
return
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'aliYun_phone b'
,
'a.aliYun_phone_i
d
=b.id'
,
'left'
)
->
join
(
'aliYun_phone b'
,
'a.aliYun_phone_i=b.id'
,
'left'
)
->
where
(
$where
)
->
find
();
}
}
\ No newline at end of file
application/route.php
View file @
ccd46b0f
...
...
@@ -256,9 +256,9 @@ Route::group('task',[
'addReport'
=>
[
'task/PrivacyNumber/addReport'
,
[
'method'
=>
'get|post'
]],
//阿里大于隐私号码回调
'queryRecordFile'
=>
[
'task/PrivacyNumber/queryRecordFile'
,
[
'method'
=>
'get'
]],
//下载录音
'releaseNumber'
=>
[
'task/PrivacyNumber/releaseNumber'
,
[
'method'
=>
'get'
]],
//释放号码
'rongBilledInf
romUrl'
=>
[
'task/PrivacyNumber/rongBilledInfro
mUrl'
,
[
'method'
=>
'post | get'
]
],
//隐私号码回调[话单通知]
'rongRecordingInf
romUrl'
=>
[
'task/PrivacyNumber/rongRecordingInfro
mUrl'
,
[
'method'
=>
'post | get'
]
],
//隐私号码回调[录音通知]
'rongStatusInf
romUrl'
=>
[
'task/PrivacyNumber/rongStatusInfro
mUrl'
,
[
'method'
=>
'post | get'
]
],
//隐私号码回调[状态通知]
'rongBilledInf
ormUrl'
=>
[
'task/PrivacyNumber/rongBilledInfor
mUrl'
,
[
'method'
=>
'post | get'
]
],
//隐私号码回调[话单通知]
'rongRecordingInf
ormUrl'
=>
[
'task/PrivacyNumber/rongRecordingInfor
mUrl'
,
[
'method'
=>
'post | get'
]
],
//隐私号码回调[录音通知]
'rongStatusInf
ormUrl'
=>
[
'task/PrivacyNumber/rongStatusInfor
mUrl'
,
[
'method'
=>
'post | get'
]
],
//隐私号码回调[状态通知]
]);
Route
::
group
(
'broker'
,
[
...
...
application/task/controller/PrivacyNumber.php
View file @
ccd46b0f
...
...
@@ -117,25 +117,24 @@ class PrivacyNumber
//话单通知
public
function
rongBilledInf
ro
mUrl
(){
public
function
rongBilledInf
or
mUrl
(){
$params
=
Request
::
instance
()
->
param
();
prt
(
$params
);
$str
=
date
(
'Y-m-d h:i:s'
)
.
' '
.
var_export
(
$params
,
true
);
file_put_contents
(
'Rongcall1.txt'
,
$str
,
FILE_APPEND
);
Log
::
write
(
json_encode
(
$str
),
'rongBilledInformUrl'
);
//记录日志
}
//录音通知
public
function
rongRecordingInf
ro
mUrl
(){
public
function
rongRecordingInf
or
mUrl
(){
$params
=
Request
::
instance
()
->
param
();
$str
=
date
(
'Y-m-d h:i:s'
)
.
' '
.
var_export
(
$params
,
true
);
file_put_contents
(
'Rongcall2.txt'
,
$str
,
FILE_APPEND
);
Log
::
write
(
json_encode
(
$str
),
'rongRecordingInformUrl'
);
//记录日志
}
//状态通知
public
function
rongStatusInf
ro
mUrl
(){
public
function
rongStatusInf
or
mUrl
(){
$params
=
Request
::
instance
()
->
param
();
$str
=
date
(
'Y-m-d h:i:s'
)
.
' '
.
var_export
(
$params
,
true
);
file_put_contents
(
'Rongcall3.txt'
,
$str
,
FILE_APPEND
);
Log
::
write
(
json_encode
(
$str
),
'rongStatusInformUrl'
);
//记录日志
}
...
...
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