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
45441145
Commit
45441145
authored
Nov 26, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异常捕获
parent
84e113ad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
110 deletions
+119
-110
CallPhoneService.php
application/api_broker/service/CallPhoneService.php
+1
-1
BrokerService.php
application/index/service/BrokerService.php
+1
-1
PrivacyNumber.php
application/task/controller/PrivacyNumber.php
+117
-108
No files found.
application/api_broker/service/CallPhoneService.php
View file @
45441145
...
@@ -185,7 +185,7 @@ class CallPhoneService
...
@@ -185,7 +185,7 @@ class CallPhoneService
}
}
if
(
!
empty
(
$call_phone
[
'phone'
]))
{
if
(
!
empty
(
$call_phone
[
'phone'
]))
{
$call_key
=
$this
->
phone_a
.
'
-
'
.
$call_phone
[
'phone'
]
.
'_'
.
$this
->
phone_b
.
'_'
.
$this
->
is_privacy
;
$call_key
=
$this
->
phone_a
.
'
_
'
.
$call_phone
[
'phone'
]
.
'_'
.
$this
->
phone_b
.
'_'
.
$this
->
is_privacy
;
$this
->
redis
->
set
(
$call_key
,
$agent_id
.
'_'
.
$user_id
.
'_'
.
$user_type
,
$time_out
);
$this
->
redis
->
set
(
$call_key
,
$agent_id
.
'_'
.
$user_id
.
'_'
.
$user_type
,
$time_out
);
}
}
...
...
application/index/service/BrokerService.php
View file @
45441145
...
@@ -126,7 +126,7 @@ class BrokerService
...
@@ -126,7 +126,7 @@ class BrokerService
$old_site_id
=
$m_district
->
getDistrictKeyById
(
'site_id'
,
[
'id'
=>
$agent_data
[
'district_id'
]]);
$old_site_id
=
$m_district
->
getDistrictKeyById
(
'site_id'
,
[
'id'
=>
$agent_data
[
'district_id'
]]);
$new_site_id
=
$m_district
->
getDistrictKeyById
(
'site_id'
,
[
'id'
=>
$data
[
'district_id'
]]);
$new_site_id
=
$m_district
->
getDistrictKeyById
(
'site_id'
,
[
'id'
=>
$data
[
'district_id'
]]);
if
(
$old_site_id
!=
$new_site_id
&&
empty
(
$data
[
'confirm_old'
])
)
{
if
(
$old_site_id
!=
$new_site_id
&&
$data
[
'confirm_old'
]
!=
1
)
{
$result
[
'msg'
]
=
'编辑部门,导致所属城市不一致'
;
$result
[
'msg'
]
=
'编辑部门,导致所属城市不一致'
;
return
$result
;
return
$result
;
}
}
...
...
application/task/controller/PrivacyNumber.php
View file @
45441145
...
@@ -91,60 +91,64 @@ class PrivacyNumber
...
@@ -91,60 +91,64 @@ class PrivacyNumber
*/
*/
public
function
addReportV2
()
public
function
addReportV2
()
{
{
$post_data
=
Request
::
instance
()
->
param
();
try
{
$save_data_arr
=
$save_data
=
[];
$post_data
=
Request
::
instance
()
->
param
();
foreach
(
$post_data
as
$k
=>
$v
)
{
$save_data_arr
=
$save_data
=
[];
$save_data
=
$v
;
foreach
(
$post_data
as
$k
=>
$v
)
{
$save_data
[
'report_id'
]
=
$v
[
'id'
];
$save_data
=
$v
;
unset
(
$save_data
[
'id'
]);
//阿里大于返回是的id改为report_id
$save_data
[
'report_id'
]
=
$v
[
'id'
];
unset
(
$save_data
[
'id'
]);
//阿里大于返回是的id改为report_id
$info
=
$this
->
redis
->
get
(
$v
[
'phone_no'
]
.
'_'
.
$v
[
'secret_no'
]
.
'_'
.
$v
[
'peer_no'
]
.
'_0'
);
if
(
empty
(
$info
))
{
$info
=
$this
->
redis
->
get
(
$v
[
'phone_no'
]
.
'_'
.
$v
[
'secret_no'
]
.
'_'
.
$v
[
'peer_no'
]
.
'_1'
);
if
(
$v
[
'phone_no'
])
{
if
(
empty
(
$info
))
{
$agent_where
[
'phone'
]
=
$v
[
'phone_no'
];
if
(
$v
[
'phone_no'
])
{
$agent_where
[
'status'
]
=
0
;
$agent_where
[
'phone'
]
=
$v
[
'phone_no'
];
$agent_where
[
'password'
]
=
[
'NOT NULL'
];
$agent_where
[
'status'
]
=
0
;
$agent_id
=
$this
->
m_agent
->
getAgentsByWhere
(
$agent_where
,
'id'
);
$agent_id
=
$this
->
m_agent
->
getAgentsByWhere
(
$agent_where
,
'id'
);
if
(
empty
(
$agent_id
))
{
if
(
empty
(
$agent_id
))
{
$phone_where
[
'phone'
]
=
$v
[
'phone_no'
];
$phone_where
[
'phone'
]
=
$v
[
'phone_no'
];
$phone_where
[
'status'
]
=
0
;
$phone_where
[
'status'
]
=
0
;
$agent_id
=
$this
->
m_agent_phone
->
getAgentsByWhere
(
$phone_where
,
'agents_id'
);
$agent_id
=
$this
->
m_agent_phone
->
getAgentsByWhere
(
$phone_where
,
'agents_id'
);
}
}
$save_data
[
'agents_id'
]
=
$agent_id
;
$save_data
[
'agents_id'
]
=
$agent_id
;
$save_data
[
'users_id'
]
=
$this
->
m_user
->
getUserByWhereValue
(
'id'
,
[
'user_phone'
=>
$save_data
[
'peer_no'
]]);
$save_data
[
'users_id'
]
=
$this
->
m_user
->
getUserByWhereValue
(
'id'
,
[
'user_phone'
=>
$save_data
[
'peer_no'
]]);
$save_data
[
'user_type'
]
=
0
;
$save_data
[
'user_type'
]
=
0
;
if
(
empty
(
$save_data
[
'users_id'
]))
{
if
(
empty
(
$save_data
[
'users_id'
]))
{
$m_landlord
=
new
GLandlordPhone
();
$m_landlord
=
new
GLandlordPhone
();
$user_id
=
$m_landlord
->
getInfo
(
'id'
,
[
'phone'
=>
$save_data
[
'peer_no'
]]);
$user_id
=
$m_landlord
->
getInfo
(
'id'
,
[
'phone'
=>
$save_data
[
'peer_no'
]]);
$save_data
[
'users_id'
]
=
$user_id
;
$save_data
[
'users_id'
]
=
$user_id
;
$save_data
[
'user_type'
]
=
1
;
$save_data
[
'user_type'
]
=
1
;
}
}
}
}
else
{
$id
=
explode
(
'_'
,
$info
);
$save_data
[
'agents_id'
]
=
$id
[
0
];
$save_data
[
'users_i'
]
=
$id
[
1
];
$save_data
[
'user_type'
]
=
$id
[
2
];
}
}
}
else
{
$call_time
=
strtotime
(
$save_data
[
'release_time'
])
-
strtotime
(
$save_data
[
'start_time'
]);
$id
=
explode
(
'_'
,
$info
);
$save_data
[
'agents_id'
]
=
$id
[
0
];
$save_data
[
'users_i'
]
=
$id
[
1
];
$save_data
[
'user_type'
]
=
$id
[
2
];
}
$call_time
=
strtotime
(
$save_data
[
'release_time'
])
-
strtotime
(
$save_data
[
'start_time'
]);
$save_data
[
'time'
]
=
$call_time
;
$save_data
[
'time'
]
=
$call_time
;
if
(
$call_time
>
0
)
{
if
(
$call_time
>
0
)
{
$end_date
=
date
(
'Y-m-d H:i:s'
,
time
());
$end_date
=
date
(
'Y-m-d H:i:s'
,
time
());
$start_date
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
"-1 day"
));
$start_date
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
"-1 day"
));
$num
=
$this
->
m_secret_report
->
getCallNumber
(
$post_data
[
0
][
'phone_no'
],
$post_data
[
0
][
'peer_no'
],
$start_date
,
$end_date
);
$num
=
$this
->
m_secret_report
->
getCallNumber
(
$post_data
[
0
][
'phone_no'
],
$post_data
[
0
][
'peer_no'
],
$start_date
,
$end_date
);
if
(
empty
(
$num
))
{
if
(
empty
(
$num
))
{
$m_service
=
new
ClientService
();
$m_service
=
new
ClientService
();
$m_service
->
saveCallNumByUserId
(
$save_data
[
'users_id'
]);
$m_service
->
saveCallNumByUserId
(
$save_data
[
'users_id'
]);
}
}
}
}
$save_data_arr
[]
=
$save_data
;
$save_data_arr
[]
=
$save_data
;
Log
::
write
(
json_encode
(
$save_data
),
'AliYunSecretReport'
);
//记录日志
Log
::
write
(
json_encode
(
$save_data
),
'AliYunSecretReport'
);
//记录日志
}
$this
->
m_secret_report
->
insertDataAll
(
$save_data_arr
);
$return
=
json_encode
([
'code'
=>
0
,
'msg'
=>
'接收成功'
]);
}
catch
(
\Exception
$e
)
{
$return
=
json_encode
([
'code'
=>
""
,
'msg'
=>
$e
->
getMessage
()]);
}
}
$this
->
m_secret_report
->
insertDataAll
(
$save_data_arr
);
return
$return
;
return
json_encode
([
'code'
=>
0
,
'msg'
=>
'接收成功'
]);
}
}
/**
/**
...
@@ -312,76 +316,81 @@ class PrivacyNumber
...
@@ -312,76 +316,81 @@ class PrivacyNumber
*/
*/
public
function
rongBilledInformUrl
()
public
function
rongBilledInformUrl
()
{
{
$params
=
Request
::
instance
()
->
param
();
try
{
/*搜索A经纪人agent_id and B客户 user_id */
$params
=
Request
::
instance
()
->
param
();
/*搜索A经纪人agent_id and B客户 user_id */
$phone
=
explode
(
'-'
,
$params
[
'userData'
]);
$phone
=
explode
(
'-'
,
$params
[
'userData'
]);
$phone_a
=
$phone
[
0
];
$phone_a
=
$phone
[
0
];
$phone_b
=
$phone
[
1
];
$phone_b
=
$phone
[
1
];
//主叫
//主叫
if
(
$phone_a
==
$params
[
'callerNum'
])
{
if
(
$phone_a
==
$params
[
'callerNum'
])
{
$call_type
=
0
;
$call_type
=
0
;
}
else
{
}
else
{
$call_type
=
1
;
$call_type
=
1
;
}
}
$data
=
[
$data
=
[
'call_id'
=>
$params
[
'callId'
],
'call_id'
=>
$params
[
'callId'
],
'phone_no'
=>
$phone_a
,
/*A*/
'phone_no'
=>
$phone_a
,
/*A*/
'secret_no'
=>
$params
[
'servingNum'
],
/*X*/
'secret_no'
=>
$params
[
'servingNum'
],
/*X*/
'peer_no'
=>
$phone_b
,
/*B*/
'peer_no'
=>
$phone_b
,
/*B*/
'start_time'
=>
$params
[
'answerTime'
],
/*被叫接听时间*/
'start_time'
=>
$params
[
'answerTime'
],
/*被叫接听时间*/
'call_time'
=>
$params
[
'startTime'
],
/*本次通话开始时间*/
'call_time'
=>
$params
[
'startTime'
],
/*本次通话开始时间*/
'release_time'
=>
$params
[
'endTime'
],
/*本次通话结束时间*/
'release_time'
=>
$params
[
'endTime'
],
/*本次通话结束时间*/
'ring_time'
=>
$params
[
'calleeRingTime'
],
/*被叫振铃时间*/
'ring_time'
=>
$params
[
'calleeRingTime'
],
/*被叫振铃时间*/
'time'
=>
$params
[
'duration'
],
/*本次通话时间*/
'time'
=>
$params
[
'duration'
],
/*本次通话时间*/
'release_dir'
=>
$params
[
'result'
],
/*本次通话的结果,0 成功2无应答 9呼叫失败 11*/
'release_dir'
=>
$params
[
'result'
],
/*本次通话的结果,0 成功2无应答 9呼叫失败 11*/
'mapping_id'
=>
$params
[
'mappingId'
],
/*绑定容联云id*/
'mapping_id'
=>
$params
[
'mappingId'
],
/*绑定容联云id*/
'type'
=>
2
,
'type'
=>
2
,
'call_display'
=>
$params
[
'calldisplay'
],
'call_display'
=>
$params
[
'calldisplay'
],
'call_type'
=>
$call_type
,
'call_type'
=>
$call_type
,
];
];
$info
=
$this
->
redis
->
get
(
$phone_a
.
'_'
.
$params
[
'servingNum'
]
.
'_'
.
$phone_b
.
'_1'
);
$info
=
$this
->
redis
->
get
(
$phone_a
.
'_'
.
$params
[
'servingNum'
]
.
'_'
.
$phone_b
.
'_2'
);
if
(
empty
(
$info
))
{
if
(
empty
(
$info
))
{
if
(
$phone_a
)
{
if
(
$phone_a
)
{
$agent_where
[
'phone'
]
=
$phone_a
;
$agent_where
[
'phone'
]
=
$phone_a
;
$agent_where
[
'status'
]
=
0
;
$agent_where
[
'status'
]
=
0
;
$agent_where
[
'password'
]
=
[
'NOT NULL'
];
$agent_where
[
'password'
]
=
[
'NOT NULL'
];
$agent_id
=
$this
->
m_agent
->
getAgentsByWhere
(
$agent_where
,
'id'
);
$agent_id
=
$this
->
m_agent
->
getAgentsByWhere
(
$agent_where
,
'id'
);
if
(
empty
(
$agent_id
))
{
if
(
empty
(
$agent_id
))
{
$phone_where
[
'phone'
]
=
$phone_a
;
$phone_where
[
'phone'
]
=
$phone_a
;
$phone_where
[
'status'
]
=
0
;
$phone_where
[
'status'
]
=
0
;
$agent_id
=
$this
->
m_agent_phone
->
getAgentsByWhere
(
$phone_where
,
'agents_id'
);
$agent_id
=
$this
->
m_agent_phone
->
getAgentsByWhere
(
$phone_where
,
'agents_id'
);
}
}
$data
[
'agents_id'
]
=
$agent_id
;
$data
[
'agents_id'
]
=
$agent_id
;
$data
[
'users_id'
]
=
$this
->
m_user
->
getUserByWhereValue
(
'id'
,
[
'user_phone'
=>
$phone_b
]);
$data
[
'users_id'
]
=
$this
->
m_user
->
getUserByWhereValue
(
'id'
,
[
'user_phone'
=>
$phone_b
]);
$data
[
'user_type'
]
=
0
;
$data
[
'user_type'
]
=
0
;
if
(
empty
(
$data
[
'users_id'
]))
{
if
(
empty
(
$data
[
'users_id'
]))
{
$m_landlord
=
new
GLandlordPhone
();
$m_landlord
=
new
GLandlordPhone
();
$user_id
=
$m_landlord
->
getInfo
(
'id'
,
[
'phone'
=>
$phone_b
]);
$user_id
=
$m_landlord
->
getInfo
(
'id'
,
[
'phone'
=>
$phone_b
]);
$data
[
'users_id'
]
=
$user_id
;
$data
[
'users_id'
]
=
$user_id
;
$data
[
'user_type'
]
=
1
;
$data
[
'user_type'
]
=
1
;
}
}
}
}
else
{
$id
=
explode
(
'_'
,
$info
);
$data
[
'agents_id'
]
=
$id
[
0
];
$data
[
'users_id'
]
=
$id
[
1
];
$data
[
'user_type'
]
=
$id
[
2
];
}
}
}
else
{
$id
=
explode
(
'_'
,
$info
);
$data
[
'agents_id'
]
=
$id
[
0
];
$data
[
'users_id'
]
=
$id
[
1
];
$data
[
'user_type'
]
=
$id
[
2
];
}
$this
->
m_secret_report
->
insertDataAll
([
0
=>
$data
]);
$this
->
m_secret_report
->
insertDataAll
([
0
=>
$data
]);
$str
=
date
(
'Y-m-d h:i:s'
)
.
' 容联云话单'
.
var_export
(
$params
,
true
);
$str
=
date
(
'Y-m-d h:i:s'
)
.
' 容联云话单'
.
var_export
(
$params
,
true
);
if
(
$params
[
'duration'
]
>
0
&&
$data
[
'users_id'
])
{
if
(
$params
[
'duration'
]
>
0
&&
$data
[
'users_id'
])
{
$m_service
=
new
ClientService
();
$m_service
=
new
ClientService
();
$m_service
->
saveCallNumByUserId
(
$data
[
'users_id'
]);
$m_service
->
saveCallNumByUserId
(
$data
[
'users_id'
]);
}
Log
::
write
(
$str
,
'rongBilledInformUrl'
);
//记录日志
$return
=
json_encode
([
"statusCode"
=>
'000000'
,
'msg'
=>
'接收成功'
]);
}
catch
(
\Exception
$e
)
{
$return
=
json_encode
([
"statusCode"
=>
''
,
'msg'
=>
$e
->
getMessage
()
]);
}
}
Log
::
write
(
$str
,
'rongBilledInformUrl'
);
//记录日志
return
$return
;
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