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
01b9a2ad
Commit
01b9a2ad
authored
Mar 19, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
容联云回调2
parent
7cd4c24c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
2 deletions
+41
-2
CellPhone.php
application/api_broker/controller/CellPhone.php
+7
-1
RongDemo.php
application/api_broker/untils/RongDemo.php
+3
-1
RongBilledInform.php
application/model/RongBilledInform.php
+14
-0
PrivacyNumber.php
application/task/controller/PrivacyNumber.php
+17
-0
No files found.
application/api_broker/controller/CellPhone.php
View file @
01b9a2ad
...
@@ -75,7 +75,13 @@ class CellPhone extends Basic
...
@@ -75,7 +75,13 @@ class CellPhone extends Basic
$Rong
=
new
RongDemo
();
$Rong
=
new
RongDemo
();
$record2
=
empty
(
$this
->
params
[
'record'
])
?
'true'
:
'false'
;
/* 是否录音(容联云规定string类型)*/
$record2
=
empty
(
$this
->
params
[
'record'
])
?
'true'
:
'false'
;
/* 是否录音(容联云规定string类型)*/
// var_dump($phone_x);/*************测试****************/
// var_dump($phone_x);/*************测试****************/
$result
=
$Rong
->
setNumber
(
$phone_a
,
$phone_b
,
$phone_x
[
'phone_x'
],
$phone_x
[
'area'
],
$record2
);
/*计算有效期*/
if
(
empty
(
$setting
[
'day_num'
])){
$yx_time
=
$setting
[
'day_num'
]
*
60
*
60
*
24
;
}
else
{
$yx_time
=
604800
;
}
$result
=
$Rong
->
setNumber
(
$phone_a
,
$phone_b
,
$phone_x
[
'phone_x'
],
$phone_x
[
'area'
],
$yx_time
,
$record2
);
/*绑定成功*/
/*绑定成功*/
// var_dump($result);/*************测试****************/
// var_dump($result);/*************测试****************/
if
(
$result
[
'statusCode'
]
==
'000000'
){
if
(
$result
[
'statusCode'
]
==
'000000'
){
...
...
application/api_broker/untils/RongDemo.php
View file @
01b9a2ad
...
@@ -129,9 +129,10 @@ class RongDemo
...
@@ -129,9 +129,10 @@ class RongDemo
* @param $xNumber
* @param $xNumber
* @param $areaCode
* @param $areaCode
* @param $record
* @param $record
* @param $yx_time
* @return string
* @return string
*/
*/
public
function
setNumber
(
$aNumber
,
$bNumber
,
$xNumber
,
$areaCode
,
$record
){
public
function
setNumber
(
$aNumber
,
$bNumber
,
$xNumber
,
$areaCode
,
$
yx_time
=
'604800'
,
$
record
){
$data
=
$this
->
components
;
$data
=
$this
->
components
;
$time
=
date
(
'YmdHis'
,
time
());
$time
=
date
(
'YmdHis'
,
time
());
$sign
=
$this
->
sigParameter
(
$time
);
/*签名*/
$sign
=
$this
->
sigParameter
(
$time
);
/*签名*/
...
@@ -145,6 +146,7 @@ class RongDemo
...
@@ -145,6 +146,7 @@ class RongDemo
'servingNumber'
=>
$xNumber
,
'servingNumber'
=>
$xNumber
,
'areaCode'
=>
$areaCode
,
'areaCode'
=>
$areaCode
,
'needRecord'
=>
$record
,
'needRecord'
=>
$record
,
'mappingDuratio'
=>
$yx_time
,
'cdrNotifyUrl'
=>
CURRENT_URL
.
"task/rongBilledInformUrl"
,
'cdrNotifyUrl'
=>
CURRENT_URL
.
"task/rongBilledInformUrl"
,
'callStateNotifyUrl'
=>
CURRENT_URL
.
"task/rongStatusInformUrl"
,
'callStateNotifyUrl'
=>
CURRENT_URL
.
"task/rongStatusInformUrl"
,
'recordNotifyUrl'
=>
CURRENT_URL
.
"task/rongRecordingInformUrl"
,
'recordNotifyUrl'
=>
CURRENT_URL
.
"task/rongRecordingInformUrl"
,
...
...
application/model/RongBilledInform.php
View file @
01b9a2ad
...
@@ -22,4 +22,17 @@ class RongBilledInform extends BaseModel
...
@@ -22,4 +22,17 @@ class RongBilledInform extends BaseModel
return
$r
;
return
$r
;
}
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getArr
(
$field
,
$where
){
$r
=
$this
->
field
(
$field
)
->
where
(
$where
)
->
select
();
return
$r
;
}
}
}
\ No newline at end of file
application/task/controller/PrivacyNumber.php
View file @
01b9a2ad
...
@@ -72,6 +72,23 @@ class PrivacyNumber
...
@@ -72,6 +72,23 @@ class PrivacyNumber
}
}
}
}
}
}
/*容联云音频下载*/
$rongRecord
=
new
RongBilledInform
();
$ids
=
array
();
$field
=
'id,mp3_url'
;
$where
=
'download=0'
;
$down_data2
=
$rongRecord
->
getArr
(
$field
,
$where
);
if
(
$down_data2
)
{
foreach
(
$down_data2
as
$k
=>
$v
)
{
$ids
[]
=
$v
[
'id'
];
$down_url2
=
explode
(
'/'
,
$v
[
'mp3_url'
]);
down_file
(
$v
[
'mp3_url'
],
ROOT_PATH
.
'public'
.
DS
.
'static'
.
DS
.
'voice'
,
array_pop
(
$down_url2
));
}
}
$id_str
=
implode
(
','
,
$ids
);
$update
[
'download'
]
=
1
;
$where
=
" id in(
$id_str
)"
;
$rongRecord
->
save
(
$update
,
$where
);
return
;
return
;
}
}
...
...
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