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
0e3780f8
Commit
0e3780f8
authored
Jul 02, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
253c3f7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
Broker.php
application/api_broker/controller/Broker.php
+12
-13
No files found.
application/api_broker/controller/Broker.php
View file @
0e3780f8
...
...
@@ -167,20 +167,20 @@ class Broker extends Basic
public
function
verifyAgentStatus
()
{
$params
=
$this
->
params
;
/* $params = array(
"agent_id" => 12,
"device_id" => "123123131"
);*/
/* $params = array(
"agent_id" => 12,
"device_id" => "123123131"
);*/
$checkResult
=
$this
->
validate
(
$params
,
"PerformanceValidate.verifyAgentStatus"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$is_visit
=
$this
->
judgeBand
(
$params
[
"device_id"
],
$params
[
"agent_id"
],
""
,
1
);
if
(
$is_visit
)
{
return
$this
->
response
(
"200"
,
"success"
,
[]);
}
else
{
return
$this
->
response
(
"101"
,
"该账号没有绑定该手机,请致电人事进行绑定。"
);
if
(
$is_visit
)
{
return
$this
->
response
(
"200"
,
"success"
,
[]);
}
else
{
return
$this
->
response
(
"101"
,
"该账号没有绑定该手机,请致电人事进行绑定。"
);
}
}
...
...
@@ -194,8 +194,6 @@ class Broker extends Basic
*/
private
function
judgeBand
(
string
$device_id
,
int
$agent_id
,
string
$model
,
int
$type
)
:
bool
{
//todo 查询是否绑定过设备id,if没有绑定则直接登陆新增绑定关系,if有绑定,则判断登陆的设备id是否存在于关系列表中,存在并且状态正常则登陆,
//todo 否则提示联系管理员开通
$aBD
=
new
ABindingDevice
();
$params
[
"agent_id"
]
=
$agent_id
;
...
...
@@ -211,10 +209,11 @@ class Broker extends Basic
if
(
$device_id
==
$item
[
"device_id"
]
&&
$item
[
"is_forbidden"
]
==
0
)
{
return
true
;
}
if
(
$device_id
==
$item
[
"device_id"
]
&&
$item
[
"is_forbidden"
]
==
1
&&
$type
==
0
)
{
//新增申请绑定关系
$aBD
->
addDevice
([
"device_id"
=>
$device_id
,
"agent_id"
=>
$agent_id
,
"model"
=>
$model
,
"is_forbidden"
=>
1
]);
}
}
//新增申请绑定关系
if
(
$type
==
0
)
$aBD
->
addDevice
([
"device_id"
=>
$device_id
,
"agent_id"
=>
$agent_id
,
"model"
=>
$model
,
"is_forbidden"
=>
1
]);
return
false
;
}
...
...
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