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
19cd37b7
Commit
19cd37b7
authored
Sep 12, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
隐私号码优化
parent
c7c519d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
16 deletions
+26
-16
CallPhoneService.php
application/api_broker/service/CallPhoneService.php
+9
-13
AliYunPhone.php
application/model/AliYunPhone.php
+17
-3
No files found.
application/api_broker/service/CallPhoneService.php
View file @
19cd37b7
...
...
@@ -318,12 +318,9 @@ class CallPhoneService
}
/**
* 容联云
* 容联云
号码绑定
*
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
yunTongXun
()
{
...
...
@@ -336,33 +333,32 @@ class CallPhoneService
}
$aliYunPhone
=
new
AliYunPhone
();
$phone_x
=
$aliYunPhone
->
getAliYunPhone
(
$this
->
phone_a
,
$this
->
phone_b
,
$this
->
is_privacy
);
//获取未绑定隐号
$result
=
$yun_tong_xun
->
setNumber
(
$this
->
phone_a
,
$this
->
phone_b
,
$phone_x
[
'phone_x'
],
$phone_x
[
'area'
],
$this
->
expiry_date
,
$record
);
$phone_x
=
$aliYunPhone
->
getAliYunPhoneAll
(
$this
->
phone_a
,
$this
->
phone_b
,
$this
->
is_privacy
,
[],
$this
->
city
);
//获取未绑定隐号
$result
=
$yun_tong_xun
->
setNumber
(
$this
->
phone_a
,
$this
->
phone_b
,
$phone_x
[
'data'
][
'phone_x'
],
$phone_x
[
'data'
][
'area'
],
$this
->
expiry_date
,
$record
);
/*绑定成功*/
if
(
$result
[
'statusCode'
]
==
'000000'
)
{
$data
[
'status'
]
=
'success'
;
$data
[
'msg'
]
=
'绑定成功。'
;
$data
[
'phone'
]
=
$phone_x
[
'phone_x'
];
$data
[
'phone'
]
=
$phone_x
[
'
data'
][
'
phone_x'
];
$this
->
mapping_id
=
$result
[
'data'
][
'mappingId'
];
}
else
{
$phone_x_arr
[]
=
$phone_x
[
'phone_x'
];
//剔除绑定失败的中间号
$phone_x_arr
[]
=
$phone_x
[
'
data'
][
'
phone_x'
];
//剔除绑定失败的中间号
//尝试5次再绑定
for
(
$i
=
0
;
$i
<
5
;
$i
++
)
{
$phone_x
=
$aliYunPhone
->
getAliYunPhone
(
$this
->
phone_a
,
$this
->
phone_b
,
$this
->
is_privacy
,
$phone_x_arr
);
//获取未绑定隐号
$result
=
$yun_tong_xun
->
setNumber
(
$this
->
phone_a
,
$this
->
phone_b
,
$phone_x
[
'
phone_x'
],
$phone_x
[
'area'
],
$this
->
expiry_date
,
$record
);
$phone_x
=
$aliYunPhone
->
getAliYunPhone
All
(
$this
->
phone_a
,
$this
->
phone_b
,
$this
->
is_privacy
,
$phone_x_arr
);
//获取未绑定隐号
$result
=
$yun_tong_xun
->
setNumber
(
$this
->
phone_a
,
$this
->
phone_b
,
$phone_x
[
'
data'
][
'phone_x'
],
$phone_x
[
'data'
]
[
'area'
],
$this
->
expiry_date
,
$record
);
if
(
$result
[
'statusCode'
]
==
'000000'
)
{
$data
[
'status'
]
=
'success'
;
$data
[
'msg'
]
=
'绑定成功。'
;
$data
[
'phone'
]
=
$phone_x
[
'phone_x'
];
$data
[
'phone'
]
=
$phone_x
[
'
data'
][
'
phone_x'
];
$this
->
mapping_id
=
$result
[
'data'
][
'mappingId'
];
break
;
}
else
{
$phone_x_arr
[]
=
$phone_x
[
'phone_x'
];
//剔除绑定失败的中间号
$phone_x_arr
[]
=
$phone_x
[
'
data'
][
'
phone_x'
];
//剔除绑定失败的中间号
}
}
...
...
application/model/AliYunPhone.php
View file @
19cd37b7
...
...
@@ -66,14 +66,27 @@ class AliYunPhone extends BaseModel
* @param $phone_b
* @param int $type
* @param array $phone_x
* @param $city
* @return mixed
*/
public
function
getAliYunPhoneAll
(
$phone_a
,
$phone_b
,
$type
=
1
,
$phone_x
=
[])
public
function
getAliYunPhoneAll
(
$phone_a
,
$phone_b
,
$type
=
1
,
$phone_x
=
[]
,
$city
)
{
$result
[
'data'
]
=
[];
$m_bind
=
new
BindingPhone
();
// if ($city == '上海') {
// $where_bind_a['area'] = '021';
// $where_bind_b['area'] = '021';
// $where_phone['area'] = '021';
// }
//
// if ($city == '杭州') {
// $where_bind_a['area'] = '0571';
// $where_bind_b['area'] = '0571';
// $where_phone['area'] = '0571';
// }
//尝试多次绑定,去除已经绑定失败的号码
if
(
!
empty
(
$phone_x
))
{
$where_bind_a
[
'b.phone_x'
]
=
[
'NOT IN'
,
$phone_x
];
...
...
@@ -87,10 +100,10 @@ class AliYunPhone extends BaseModel
$id_arr_a
=
$m_bind
->
getBindingPhoneList
(
'b.id'
,
$where_bind_a
);
//找到phone_b绑定的隐私号码
$where_bind_b
[
'a.phone_
a
'
]
=
$phone_b
;
$where_bind_b
[
'a.phone_
b
'
]
=
$phone_b
;
$where_bind_b
[
'a.status'
]
=
1
;
$where_bind_b
[
'b.type'
]
=
$type
;
$id_arr_b
=
$m_bind
->
getBindingPhoneList
(
'b.id'
,
$where_bind_
a
);
$id_arr_b
=
$m_bind
->
getBindingPhoneList
(
'b.id'
,
$where_bind_
b
);
$id_merge
=
array_merge
(
$id_arr_a
[
'data'
],
$id_arr_b
[
'data'
]);
...
...
@@ -101,6 +114,7 @@ class AliYunPhone extends BaseModel
$id
=
empty
(
$id
)
?
0
:
$id
;
$where_phone
[
'status'
]
=
0
;
$where_phone
[
'type'
]
=
$type
;
$where_phone
[
'bind_num'
]
=
[
'<'
,
201
];
try
{
if
(
empty
(
$id
))
{
...
...
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