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
b38806b1
Commit
b38806b1
authored
Sep 18, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
容联云号码绑定修改
parent
d93c3844
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
28 deletions
+34
-28
CallPhoneService.php
application/api_broker/service/CallPhoneService.php
+6
-4
AliYunPhone.php
application/model/AliYunPhone.php
+25
-23
BindingPhone.php
application/model/BindingPhone.php
+3
-1
No files found.
application/api_broker/service/CallPhoneService.php
View file @
b38806b1
...
...
@@ -163,6 +163,7 @@ class CallPhoneService
$result
[
'phone'
]
=
$call_phone
[
'phone'
];
$result
[
'msg'
]
=
$call_phone
[
'msg'
];
$type
=
'AliYunBindAxb'
;
$bind
->
recordBindPhone
(
$call_phone
[
'phone'
],
$phone_a
,
$phone_b
,
$record
,
$this
->
expiry_date
,
$this
->
subs_id
,
$this
->
request_id
,
$this
->
mapping_id
,
$this
->
is_privacy
,
$this
->
release
);
}
else
{
$result
[
'msg'
]
=
$call_phone
[
'msg'
];
}
...
...
@@ -174,15 +175,15 @@ class CallPhoneService
$result
[
'phone'
]
=
$call_phone
[
'phone'
];
$result
[
'msg'
]
=
$call_phone
[
'msg'
];
$type
=
'YunTongXunBindAxb'
;
$bind
->
recordBindPhone
(
$call_phone
[
'phone'
],
$phone_a
,
$phone_b
,
$record
,
$this
->
expiry_date
,
$this
->
subs_id
,
$this
->
request_id
,
$this
->
mapping_id
,
$this
->
is_privacy
,
$this
->
release
);
$bind
->
commit
();
}
else
{
$bind
->
rollback
();
$result
[
'msg'
]
=
$call_phone
[
'msg'
];
}
}
if
(
$result
[
'status'
]
==
'success'
)
{
$bind
->
recordBindPhone
(
$call_phone
[
'phone'
],
$phone_a
,
$phone_b
,
$record
,
$this
->
expiry_date
,
$this
->
subs_id
,
$this
->
request_id
,
$this
->
mapping_id
,
$this
->
is_privacy
,
$this
->
release
);
}
Log
::
write
(
json_encode
(
$result
),
$type
);
//记录日志
}
catch
(
\Exception
$e
)
{
$data
[
'status'
]
=
'failed'
;
...
...
@@ -320,6 +321,7 @@ class CallPhoneService
* 容联云号码绑定
*
* @return mixed
* @throws \think\exception\PDOException
*/
public
function
yunTongXun
()
{
...
...
application/model/AliYunPhone.php
View file @
b38806b1
...
...
@@ -68,6 +68,7 @@ class AliYunPhone extends BaseModel
* @param array $phone_x
* @param $city
* @return mixed
* @throws \think\exception\PDOException
*/
public
function
getAliYunPhoneAll
(
$phone_a
,
$phone_b
,
$type
=
1
,
$phone_x
=
[],
$city
)
{
...
...
@@ -92,31 +93,31 @@ class AliYunPhone extends BaseModel
$where_bind_a
[
'b.phone_x'
]
=
[
'NOT IN'
,
$phone_x
];
$where_bind_b
[
'b.phone_x'
]
=
[
'NOT IN'
,
$phone_x
];
}
try
{
$this
->
startTrans
();
//找到与phone_a绑定的隐私号码
$where_bind_a
[
'a.phone_a'
]
=
$phone_a
;
$where_bind_a
[
'a.status'
]
=
1
;
$where_bind_a
[
'b.type'
]
=
$type
;
$id_arr_a
=
$m_bind
->
getBindingPhoneList
(
'b.id'
,
$where_bind_a
,
true
);
//找到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_b
,
true
);
$id_merge
=
array_merge
(
$id_arr_a
[
'data'
],
$id_arr_b
[
'data'
]);
foreach
(
$id_merge
as
$k
=>
$v
)
{
$id
[
$k
]
=
$v
[
'id'
];
//去除phone_a已经绑定的号码
}
//找到与phone_a绑定的隐私号码
$where_bind_a
[
'a.phone_a'
]
=
$phone_a
;
$where_bind_a
[
'a.status'
]
=
1
;
$where_bind_a
[
'b.type'
]
=
$type
;
$id_arr_a
=
$m_bind
->
getBindingPhoneList
(
'b.id'
,
$where_bind_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_b
);
$id_merge
=
array_merge
(
$id_arr_a
[
'data'
],
$id_arr_b
[
'data'
]);
foreach
(
$id_merge
as
$k
=>
$v
)
{
$id
[
$k
]
=
$v
[
'id'
];
//去除phone_a已经绑定的号码
}
$id
=
empty
(
$id
)
?
0
:
$id
;
$where_phone
[
'status'
]
=
0
;
$where_phone
[
'type'
]
=
$type
;
$where_phone
[
'bind_num'
]
=
[
'<'
,
201
];
$id
=
empty
(
$id
)
?
0
:
$id
;
$where_phone
[
'status'
]
=
0
;
$where_phone
[
'type'
]
=
$type
;
$where_phone
[
'bind_num'
]
=
[
'<'
,
201
];
try
{
if
(
empty
(
$id
))
{
$result
[
'data'
]
=
$this
->
field
(
'id,phone_x,area'
)
->
where
(
$where_phone
)
->
find
();
}
else
{
...
...
@@ -125,6 +126,7 @@ class AliYunPhone extends BaseModel
}
$result
[
'status'
]
=
'successful'
;
}
catch
(
\Exception
$e
)
{
$this
->
commit
();
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
$e
->
getMessage
();
}
...
...
application/model/BindingPhone.php
View file @
b38806b1
...
...
@@ -112,15 +112,17 @@ class BindingPhone extends BaseModel
*
* @param $field
* @param $where
* @param bool $is_lock
* @return mixed
*/
public
function
getBindingPhoneList
(
$field
,
$where
)
public
function
getBindingPhoneList
(
$field
,
$where
,
$is_lock
=
false
)
{
$data
[
'data'
]
=
[];
try
{
$data
[
'data'
]
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'aliYun_phone b'
,
'a.aliYun_phone_id = b.id'
,
'left'
)
->
where
(
$where
)
->
lock
(
$is_lock
)
->
select
();
$data
[
'status'
]
=
'successful'
;
}
catch
(
\Exception
$e
)
{
...
...
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