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
0ddeafc5
Commit
0ddeafc5
authored
Nov 13, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
隐私号码回调接口优化
parent
395cf1f7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
30 deletions
+36
-30
AliYunSecretReport.php
application/model/AliYunSecretReport.php
+5
-0
route.php
application/route.php
+1
-1
PrivacyNumber.php
application/task/controller/PrivacyNumber.php
+30
-29
No files found.
application/model/AliYunSecretReport.php
View file @
0ddeafc5
...
...
@@ -149,4 +149,8 @@ class AliYunSecretReport extends BaseModel
->
where
(
$where
)
->
select
();
}
public
function
insertDataAll
(
$data
)
{
$this
->
allowField
(
true
)
->
saveAll
(
$data
);
}
}
\ No newline at end of file
application/route.php
View file @
0ddeafc5
...
...
@@ -475,7 +475,7 @@ Route::group('chat', [
Route
::
group
(
'task'
,
[
'exclusiveExpirationTime'
=>
[
'task/exclusive/exclusiveExpirationTime'
,
[
'method'
=>
'get'
]],
//独家过期时间
'addReport'
=>
[
'task/PrivacyNumber/addReport'
,
[
'method'
=>
'get|post'
]],
//阿里大于隐私号码回调
'addReport'
=>
[
'task/PrivacyNumber/addReport
V2
'
,
[
'method'
=>
'get|post'
]],
//阿里大于隐私号码回调
'queryRecordFile'
=>
[
'task/PrivacyNumber/queryRecordFile'
,
[
'method'
=>
'get'
]],
//下载录音
'releaseNumber'
=>
[
'task/PrivacyNumber/releaseNumber'
,
[
'method'
=>
'get'
]],
//释放号码
'checkBindPhone'
=>
[
'task/PrivacyNumber/checkBindPhone'
,
[
'method'
=>
'get'
]],
//检查绑定关系,去除表中不存在的绑定关系
...
...
application/task/controller/PrivacyNumber.php
View file @
0ddeafc5
...
...
@@ -91,9 +91,10 @@ class PrivacyNumber
public
function
addReportV2
()
{
$post_data
=
Request
::
instance
()
->
param
();
foreach
(
$post_data
as
$k
=>
$v
)
{
$save_data_arr
=
$save_data
=
[];
foreach
(
$post_data
as
$k
=>
$v
)
{
$save_data
=
$v
;
$save_data
[
'report_id'
]
=
$
post_data
[
0
]
[
'id'
];
$save_data
[
'report_id'
]
=
$
v
[
'id'
];
unset
(
$save_data
[
'id'
]);
//阿里大于返回是的id改为report_id
if
(
$v
[
'phone_no'
])
{
$agent_where
[
'phone'
]
=
$v
[
'phone_no'
];
...
...
@@ -106,7 +107,7 @@ class PrivacyNumber
$agent_id
=
$this
->
m_agent_phone
->
getAgentsByWhere
(
$phone_where
,
'agents_id'
);
}
$save_data
[
'agents_id'
]
=
$agent_id
;
$save_data
[
'users_id'
]
=
$this
->
m_user
->
getUserByWhereValue
([
'user_phone'
=>
$save_data
[
'peer_no'
]],
'id'
);
$save_data
[
'users_id'
]
=
$this
->
m_user
->
getUserByWhereValue
(
'id'
,
[
'user_phone'
=>
$save_data
[
'peer_no'
]]
);
}
$call_time
=
strtotime
(
$save_data
[
'release_time'
])
-
strtotime
(
$save_data
[
'start_time'
]);
...
...
@@ -122,11 +123,11 @@ class PrivacyNumber
}
}
$this
->
m_secret_report
->
allowField
(
true
)
->
save
(
$save_data
);
$save_data_arr
[]
=
$save_data
;
Log
::
write
(
json_encode
(
$save_data
),
'AliYunSecretReport'
);
//记录日志
}
Log
::
write
(
json_encode
(
$post_data
[
0
]),
'AliYunSecretReport'
);
//记录日志
return
json_encode
([
'code'
=>
0
,
'msg'
=>
'接收成功'
]);
$this
->
m_secret_report
->
insertDataAll
(
$save_data_arr
);
return
json_encode
([
'code'
=>
0
,
'msg'
=>
'接收成功'
]);
}
/**
...
...
@@ -154,12 +155,11 @@ class PrivacyNumber
$where
[
'record_down'
]
=
1
;
}
$m_secret
=
new
AliYunSecretReport
();
$fields
=
'id,call_id,call_time,voice_file,type,record_down,mp3_url'
;
$where
[
'time'
]
=
[
'>'
,
0
];
$where
[
'type'
]
=
[
'>'
,
0
];
$down_data
=
$
m_secre
t
->
secretReportAll
(
$fields
,
$where
);
$down_data
=
$
this
->
m_secret_repor
t
->
secretReportAll
(
$fields
,
$where
);
$is_down
=
''
;
foreach
(
$down_data
as
$k
=>
$v
)
{
...
...
@@ -189,7 +189,7 @@ class PrivacyNumber
if
(
$data
[
'record_down'
]
==
1
)
{
$data
[
'voice_file'
]
=
date
(
'Ymd'
)
.
'/'
.
basename
(
$is_down
);
}
$
m_secre
t
->
updateDownStatus
(
$v
[
'id'
],
$data
);
$
this
->
m_secret_repor
t
->
updateDownStatus
(
$v
[
'id'
],
$data
);
}
}
...
...
@@ -204,9 +204,6 @@ class PrivacyNumber
public
function
releaseNumber
()
{
set_time_limit
(
0
);
$m_bind
=
new
BindingPhone
();
$m_agent
=
new
AAgents
();
$m_agent_phone
=
new
AAgentsPhone
();
$date
=
date
(
'Y-m-d'
)
.
' 23:59:59'
;
$fields
=
'a.id,aliYun_phone_id,expiry_date,phone_x,phone_a,phone_b,subsId,a.type,a.mappingId'
;
$where
[
'a.status'
]
=
1
;
...
...
@@ -214,21 +211,20 @@ class PrivacyNumber
$where_count
[
'status'
]
=
1
;
$where_count
[
'expiry_date'
]
=
[
'<='
,
$date
];
$total
=
$m_bind
->
getTotal
(
$where_count
);
$total
=
$
this
->
m_bind
->
getTotal
(
$where_count
);
$pageSize
=
5000
;
$pageTotal
=
ceil
(
$total
/
$pageSize
);
for
(
$pageNo
=
1
;
$pageNo
<=
$pageTotal
;
$pageNo
++
)
{
$bind_data
=
$m_bind
->
getBindingPhoneListLimit
(
$pageNo
,
$pageSize
,
$fields
,
$where
);
$bind_data
=
$
this
->
m_bind
->
getBindingPhoneListLimit
(
$pageNo
,
$pageSize
,
$fields
,
$where
);
$binding_phone_id
=
[];
$phone_id
=
[];
$bind
=
new
BindingPhone
();
foreach
(
$bind_data
[
'data'
]
as
$k
=>
$v
)
{
$agent_id
=
$m_agent
->
getAgentsByWhereColumn
([
'status'
=>
0
,
'phone'
=>
$v
[
'phone_a'
]],
'id'
);
$agent_id
=
$
this
->
m_agent
->
getAgentsByWhereColumn
([
'status'
=>
0
,
'phone'
=>
$v
[
'phone_a'
]],
'id'
);
if
(
empty
(
$agent_id
))
{
$agent_id
=
$m_agent_phone
->
getAgentsByWhereColumn
([
'status'
=>
0
,
'phone'
=>
$v
[
'phone_a'
]],
'agents_id'
);
$agent_id
=
$
this
->
m_agent_phone
->
getAgentsByWhereColumn
([
'status'
=>
0
,
'phone'
=>
$v
[
'phone_a'
]],
'agents_id'
);
}
//解除绑定
...
...
@@ -278,7 +274,7 @@ class PrivacyNumber
}
if
(
!
empty
(
$update
))
{
$bind
->
updateAll
(
$update
);
$
this
->
m_
bind
->
updateAll
(
$update
);
unset
(
$update
);
}
...
...
@@ -313,7 +309,7 @@ class PrivacyNumber
$call_type
=
1
;
}
$dat
e
=
[
$dat
a
=
[
'call_id'
=>
$params
[
'callId'
],
'phone_no'
=>
$phone_a
,
/*A*/
'secret_no'
=>
$params
[
'servingNum'
],
/*X*/
...
...
@@ -331,21 +327,26 @@ class PrivacyNumber
];
if
(
$phone_a
)
{
$agents_id
=
Db
::
table
(
'a_agents'
)
->
where
([
'phone'
=>
$phone_a
,
'status'
=>
0
])
->
value
(
'id'
);
if
(
empty
(
$agents_id
))
{
$agents_id
=
Db
::
table
(
'a_agents_phone'
)
->
where
([
'phone'
=>
$phone_a
,
'status'
=>
0
])
->
value
(
'agents_id'
);
$agent_where
[
'phone'
]
=
$phone_a
;
$agent_where
[
'status'
]
=
0
;
$agent_where
[
'password'
]
=
[
'NOT NULL'
];
$agent_id
=
$this
->
m_agent
->
getAgentsByWhere
(
$agent_where
,
'id'
);
if
(
empty
(
$agent_id
))
{
$phone_where
[
'phone'
]
=
$phone_a
;
$phone_where
[
'status'
]
=
0
;
$agent_id
=
$this
->
m_agent_phone
->
getAgentsByWhere
(
$phone_where
,
'agents_id'
);
}
$dat
e
[
'agents_id'
]
=
$agents
_id
;
$dat
e
[
'users_id'
]
=
Db
::
table
(
'u_users'
)
->
where
(
'user_phone'
,
$phone_b
)
->
value
(
'id'
);
$dat
a
[
'agents_id'
]
=
$agent
_id
;
$dat
a
[
'users_id'
]
=
$this
->
m_user
->
getUserByWhereValue
(
'id'
,
[
'user_phone'
=>
$phone_b
]
);
}
$this
->
m_secret_report
->
allowField
(
true
)
->
save
(
$date
);
$this
->
m_secret_report
->
insertDataAll
([
0
=>
$data
]
);
$str
=
date
(
'Y-m-d h:i:s'
)
.
' 容联云话单'
.
var_export
(
$params
,
true
);
if
(
$params
[
'duration'
]
>
0
&&
$dat
e
[
'users_id'
])
{
if
(
$params
[
'duration'
]
>
0
&&
$dat
a
[
'users_id'
])
{
$m_service
=
new
ClientService
();
$m_service
->
saveCallNumByUserId
(
$dat
e
[
'users_id'
]);
$m_service
->
saveCallNumByUserId
(
$dat
a
[
'users_id'
]);
}
Log
::
write
(
$str
,
'rongBilledInformUrl'
);
//记录日志
return
json_encode
([
"statusCode"
=>
'000000'
,
'msg'
=>
'接收成功'
]);
...
...
@@ -361,7 +362,7 @@ class PrivacyNumber
$params
=
Request
::
instance
()
->
param
();
$where
[
'call_id'
]
=
$params
[
'callId'
];
$update
[
'mp3_url'
]
=
$params
[
'recordUrl'
];
$this
->
m_secret_report
->
save
(
$update
,
$where
);
$this
->
m_secret_report
->
editData
(
$update
,
$params
[
'callId'
],
'call_id'
);
$str
=
date
(
'Y-m-d h:i:s'
)
.
' 容联云录音'
.
var_export
(
$params
,
true
);
Log
::
write
(
$str
,
'rongRecordingInformUrl'
);
//记录日志
return
json_encode
([
"statusCode"
=>
'000000'
,
'msg'
=>
'接收成功'
]);
...
...
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