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
2ca2a78b
Commit
2ca2a78b
authored
Jun 13, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
尝试5次绑定
parent
ae55beb8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
CellPhone.php
application/api_broker/controller/CellPhone.php
+19
-2
AliYunPhone.php
application/model/AliYunPhone.php
+7
-2
No files found.
application/api_broker/controller/CellPhone.php
View file @
2ca2a78b
...
...
@@ -83,8 +83,25 @@ class CellPhone extends Basic
$this
->
msg
=
'绑定成功。'
;
$this
->
data
=
[
'phone'
=>
$phone_x
[
'phone_x'
]];
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'号码绑定冲突,请联系运营人员!'
;
//尝试5次绑定
for
(
$i
=
1
;
$i
<
5
;
$i
++
)
{
$phone_x
=
$aliYunPhone
->
getAliYunPhone
(
$phone_a
,
$phone_b
,
$setting
[
'is_privacy'
],
$phone_x
);
$result
=
PlsDemo
::
bindAxb
(
$phone_a
,
$phone_b
,
$time
,
$record
,
$phone_x
);
//再尝试一下
if
(
$result
->
Message
==
'OK'
)
{
$aliYunPhone
->
editStatus
(
$phone_x
,
$phone_a
,
$phone_b
,
$record
,
$time
,
$result
,
''
,
$setting
[
'is_privacy'
]);
//记录绑定
$this
->
msg
=
'绑定成功。'
;
$this
->
data
=
[
'phone'
=>
$phone_x
[
'phone_x'
]];
break
;
}
else
{
$phone_x_array
[]
=
$phone_x
;
//记录绑定冲突号码,重新分配
}
}
if
(
$result
->
Message
!=
'OK'
)
{
$this
->
code
=
101
;
$this
->
msg
=
'号码绑定冲突,请联系运营人员!'
;
}
}
}
else
{
/*容联云*/
...
...
application/model/AliYunPhone.php
View file @
2ca2a78b
...
...
@@ -20,19 +20,24 @@ class AliYunPhone extends BaseModel
*
* @param $phone_a
* @param $phone_b
* @param $type
* @param int $type
* @param array $phone_x
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAliYunPhone
(
$phone_a
,
$phone_b
,
$type
=
1
)
{
public
function
getAliYunPhone
(
$phone_a
,
$phone_b
,
$type
=
1
,
array
$phone_x
=
[]
)
{
//找到phone_a和phone_b出现在两个字段中
$where_bind
[]
=
[
'EXP'
,
"(a.phone_a='
{
$phone_a
}
' or a.phone_b='
{
$phone_a
}
') or (a.phone_a='
{
$phone_b
}
' or a.phone_b='
{
$phone_b
}
')"
];
$where_bind
[
'a.status'
]
=
1
;
$where_bind
[
'b.bind_num'
]
=
[
'<='
,
200
];
$where_bind
[
'b.type'
]
=
$type
;
if
(
!
empty
(
$phone_x
))
{
$where_bind
[
'b.phone_x'
]
=
[
'NOT IN'
,
implode
(
','
,
$phone_x
)];
}
$m_bind
=
new
BindingPhone
();
$id_arr
=
$m_bind
->
getBindingPhoneList
(
'b.id'
,
$where_bind
);
...
...
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