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
253c3f7a
Commit
253c3f7a
authored
Jul 02, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验证是否以解绑,在商铺详情页和客户详情页调用
parent
eda188ff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
8 deletions
+37
-8
Broker.php
application/api_broker/controller/Broker.php
+31
-5
PerformanceValidate.php
application/api_broker/validate/PerformanceValidate.php
+5
-3
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Broker.php
View file @
253c3f7a
...
...
@@ -113,7 +113,6 @@ class Broker extends Basic
return
$this
->
response
(
"101"
,
$checkResult
);
}
$field
=
'id,store_id,auth_group_id,district_id,level,name,phone,password,sex,img,inviter_id,status'
;
$where
[
'phone'
]
=
$params
[
'phone'
];
$where
[
'id'
]
=
[
'<>'
,
1
];
...
...
@@ -134,7 +133,7 @@ class Broker extends Basic
return
$this
->
response
(
101
,
'密码错误'
);
}
//判断设备id是否存在
$is_login
=
$this
->
judgeBand
(
$params
[
"device_id"
],
$agents_data
[
'id'
],
$params
[
"model"
]);
$is_login
=
$this
->
judgeBand
(
$params
[
"device_id"
],
$agents_data
[
'id'
],
$params
[
"model"
]
,
0
);
if
(
!
$is_login
)
{
return
$this
->
response
(
"101"
,
"该账号没有绑定该手机,请致电人事进行绑定。"
);
}
...
...
@@ -161,14 +160,39 @@ class Broker extends Basic
return
$this
->
response
(
200
,
$data
[
'msg'
],
$data
[
'data'
]);
}
/**
* 判断经济人是否在后台被解绑
* @return \think\Response
*/
public
function
verifyAgentStatus
()
{
$params
=
$this
->
params
;
/* $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"
,
"该账号没有绑定该手机,请致电人事进行绑定。"
);
}
}
/**
* 判断设备绑定关系
* @param string $device_id
* @param int $agent_id
* @param string $model
* @param int $type 0提交记录到后台, 1仅仅判断
* @return bool
*/
private
function
judgeBand
(
string
$device_id
,
int
$agent_id
,
string
$model
)
:
bool
private
function
judgeBand
(
string
$device_id
,
int
$agent_id
,
string
$model
,
int
$type
)
:
bool
{
//todo 查询是否绑定过设备id,if没有绑定则直接登陆新增绑定关系,if有绑定,则判断登陆的设备id是否存在于关系列表中,存在并且状态正常则登陆,
//todo 否则提示联系管理员开通
...
...
@@ -179,7 +203,8 @@ class Broker extends Basic
$result
=
$aBD
->
getDeviceByAgentId
(
$params
);
if
(
count
(
$result
)
<=
0
)
{
//新增设备绑定关系
$aBD
->
addDevice
([
"device_id"
=>
$device_id
,
"agent_id"
=>
$agent_id
,
"model"
=>
$model
,
"is_forbidden"
=>
0
]);
if
(
$type
==
0
)
$aBD
->
addDevice
([
"device_id"
=>
$device_id
,
"agent_id"
=>
$agent_id
,
"model"
=>
$model
,
"is_forbidden"
=>
0
]);
return
true
;
}
foreach
(
$result
as
$item
)
{
...
...
@@ -188,7 +213,8 @@ class Broker extends Basic
}
}
//新增申请绑定关系
$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
;
}
...
...
application/api_broker/validate/PerformanceValidate.php
View file @
253c3f7a
...
...
@@ -34,8 +34,9 @@ class PerformanceValidate extends Validate
];
protected
$scene
=
[
'verify'
=>
[
'type'
,
'agent_id'
],
'verifyOther'
=>
[
'agent_id'
],
'login'
=>
[
'phone'
,
'pwd'
,
'device_id'
],
'verify'
=>
[
'type'
,
'agent_id'
],
'verifyOther'
=>
[
'agent_id'
],
'login'
=>
[
'phone'
,
'pwd'
,
'device_id'
],
'verifyStatus'
=>
[
'phone'
,
'device_id'
],
];
}
\ No newline at end of file
application/route.php
View file @
253c3f7a
...
...
@@ -375,6 +375,7 @@ Route::group('broker', [
'login'
=>
[
'api_broker/Broker/login'
,
[
'method'
=>
'post'
]
],
//经纪人登陆 废弃
'loginV2'
=>
[
'api_broker/Broker/loginV2'
,
[
'method'
=>
'post'
]
],
//经纪人登陆
'verifyAgentStatus'
=>
[
'api_broker/Broker/verifyAgentStatus'
,
[
'method'
=>
'post'
]
],
//判断经纪人是否被解绑
'editAgent'
=>
[
'api_broker/Broker/editAgent'
,
[
'method'
=>
'post'
]
],
//经纪人修改密码
'forgetPwd'
=>
[
'api_broker/Broker/forgetPwd'
,
[
'method'
=>
'post'
]
],
//经纪人忘记密码
'uploadHeadImg'
=>
[
'api_broker/Broker/uploadHeadImg'
,
[
'method'
=>
'post'
]
],
//经纪人上传头像
...
...
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