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
21606266
Commit
21606266
authored
Mar 20, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
容联云and阿里云订单表合并
parent
37ab51d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
12 deletions
+40
-12
SecretReport.php
application/model/SecretReport.php
+13
-0
PrivacyNumber.php
application/task/controller/PrivacyNumber.php
+27
-12
No files found.
application/model/SecretReport.php
View file @
21606266
...
...
@@ -212,4 +212,17 @@ class SecretReport extends Model
}
return
$price
;
}
/**
* @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
;
}
}
application/task/controller/PrivacyNumber.php
View file @
21606266
...
...
@@ -75,18 +75,18 @@ class PrivacyNumber
/*容联云音频下载*/
$rongRecord
=
new
RongBilledInform
();
$ids
=
array
();
$field
=
'id,
mp3_url
'
;
$where
=
'
download
=0'
;
$field
=
'id,
voice_file
'
;
$where
=
'
record_down
=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
));
$down_url2
=
explode
(
'/'
,
$v
[
'
voice_file
'
]);
down_file
(
$v
[
'
voice_file
'
],
ROOT_PATH
.
'public'
.
DS
.
'static'
.
DS
.
'voice'
,
array_pop
(
$down_url2
));
}
}
$id_str
=
implode
(
','
,
$ids
);
$update
[
'
download
'
]
=
1
;
$update
[
'
record_down
'
]
=
1
;
$where
=
" id in(
$id_str
)"
;
$rongRecord
->
save
(
$update
,
$where
);
...
...
@@ -142,17 +142,32 @@ class PrivacyNumber
$params
=
Request
::
instance
()
->
param
();
/*搜索A经纪人agent_id and B客户 user_id */
$date
=
[
'call_id'
=>
$params
[
'callId'
],
'phone_no'
=>
$params
[
'callerNum'
],
/*A*/
'secret_no'
=>
$params
[
'calleeNum'
],
/*X*/
'peer_no'
=>
$params
[
'servingNum'
],
/*B*/
'start_time'
=>
$params
[
'answerTime'
],
/*被叫接听时间*/
'call_time'
=>
$params
[
'startTime'
],
/*本次通话开始时间*/
'release_time'
=>
$params
[
'endTime'
],
/*本次通话结束时间*/
'ring_time'
=>
$params
[
'calleeRingTime'
],
/*被叫振铃时间*/
'time'
=>
$params
[
'duration'
],
/*本次通话时间*/
'release_dir'
=>
$params
[
'result'
],
/*本次通话的结果,0 成功2无应答 9呼叫失败 11*/
'mapping_id'
=>
$params
[
'mappingId'
],
/*绑定容联云id*/
'type'
=>
2
,
'call_display'
=>
$params
[
'calldisplay'
],
];
$phone_a
=
$params
[
'callerNum'
];
if
(
$phone_a
)
{
$agents_id
=
Db
::
table
(
'agents'
)
->
where
(
"phone='
{
$phone_a
}
' AND password IS NOT NULL"
)
->
value
(
'id'
);
if
(
empty
(
$agents_id
))
{
$agents_id
=
Db
::
table
(
'a_agents_phone'
)
->
where
(
'phone'
,
$phone_a
)
->
value
(
'agents_id'
);
}
$
params
[
'agents_id'
]
=
$agents_id
;
$
params
[
'users_id'
]
=
Db
::
table
(
'u_users'
)
->
where
(
'user_phone'
,
$phone_a
)
->
value
(
'id'
);
$
date
[
'agents_id'
]
=
$agents_id
;
$
date
[
'users_id'
]
=
Db
::
table
(
'u_users'
)
->
where
(
'user_phone'
,
$phone_a
)
->
value
(
'id'
);
}
$report
=
new
RongBilledInform
();
$report
->
allowField
(
true
)
->
save
(
$
params
);
$report
=
new
SecretReport
();
$report
->
allowField
(
true
)
->
save
(
$
date
);
$str
=
date
(
'Y-m-d h:i:s'
)
.
' 容联云话单'
.
var_export
(
$params
,
true
);
...
...
@@ -163,9 +178,9 @@ class PrivacyNumber
//录音通知
public
function
rongRecordingInformUrl
(){
$params
=
Request
::
instance
()
->
param
();
$report
=
new
RongBilledInform
();
$where
[
'call
I
d'
]
=
$params
[
'callId'
];
$update
[
'
mp3_url
'
]
=
$params
[
'recordUrl'
];
$report
=
new
SecretReport
();
$where
[
'call
_i
d'
]
=
$params
[
'callId'
];
$update
[
'
voice_file
'
]
=
$params
[
'recordUrl'
];
$report
->
save
(
$update
,
$where
);
$str
=
date
(
'Y-m-d h:i:s'
)
.
' 容联云录音'
.
var_export
(
$params
,
true
);
Log
::
write
(
$str
,
'rongRecordingInformUrl'
);
//记录日志
...
...
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