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
9f5357ab
Commit
9f5357ab
authored
Jul 09, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限判断
parent
46c179c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
5 deletions
+27
-5
Bargain.php
application/api_broker/controller/Bargain.php
+27
-5
No files found.
application/api_broker/controller/Bargain.php
View file @
9f5357ab
...
@@ -4,6 +4,8 @@ namespace app\api_broker\controller;
...
@@ -4,6 +4,8 @@ namespace app\api_broker\controller;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\BargainService
;
use
app\api_broker\service\BargainService
;
use
app\api_broker\service\RedisCacheService
;
use
app\api_broker\service\VerifyService
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
think\Log
;
use
think\Log
;
use
think\Request
;
use
think\Request
;
...
@@ -94,19 +96,39 @@ class Bargain extends Basic
...
@@ -94,19 +96,39 @@ class Bargain extends Basic
$is_my_correlation
=
$params
[
"is_my_correlation"
];
$is_my_correlation
=
$params
[
"is_my_correlation"
];
$keyword
=
empty
(
$params
[
"keyword"
])
?
""
:
$params
[
"keyword"
];
$keyword
=
empty
(
$params
[
"keyword"
])
?
""
:
$params
[
"keyword"
];
$bargain_id
=
empty
(
$params
[
'bargain_id'
])
?
''
:
$params
[
'bargain_id'
];
$bargain_id
=
empty
(
$params
[
'bargain_id'
])
?
''
:
$params
[
'bargain_id'
];
/*业务员不允许点击查看全部成交报告 start*/
$agent_field
=
"a.level"
;
$agent_res
=
$this
->
agentModel
->
getAgentsInfoByAgentId
(
$agent_field
,
[
"agent_id"
=>
$submit_agent_id
]);
if
((
$agent_res
[
0
][
'level'
]
==
10
)
&&
(
$is_my_correlation
==
0
)){
/*权限 start*/
$is_can_look_res
=
$this
->
isCanLook
(
$params
[
"submit_agent_id"
],
$is_my_correlation
);
if
(
$is_can_look_res
){
return
$this
->
response
(
"101"
,
"暂无权限!"
);
return
$this
->
response
(
"101"
,
"暂无权限!"
);
}
}
/*
业务员不允许点击查看全部成交报告
end*/
/*
权限
end*/
$result
=
$this
->
service_
->
getBargainList
(
$pageNo
,
$pageSize
,
$submit_agent_id
,
$status
,
$is_my_correlation
,
$keyword
,
$bargain_id
);
$result
=
$this
->
service_
->
getBargainList
(
$pageNo
,
$pageSize
,
$submit_agent_id
,
$status
,
$is_my_correlation
,
$keyword
,
$bargain_id
);
return
$this
->
response
(
"200"
,
"success"
,
$result
);
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
}
/**
* 权限判断
* @param $agent_id
* @param $is_my_correlation
* @return array
*/
public
function
isCanLook
(
$agent_id
,
$is_my_correlation
){
$redis
=
new
RedisCacheService
();
//排除 总负责人等角色
$agent_data
=
$redis
->
getRedisCache
(
2
,
$agent_id
);
$auth_rule_id
=
$agent_data
[
'auth_group_id'
];
if
(
!
in_array
(
$auth_rule_id
,
[
1
,
2
,
22
,
23
,
25
,
26
]))
{
$agent_field
=
"a.level"
;
$agent_res
=
$this
->
agentModel
->
getAgentsInfoByAgentId
(
$agent_field
,
[
"agent_id"
=>
$agent_id
]);
if
((
$agent_res
[
0
][
'level'
]
==
10
)
&&
(
$is_my_correlation
==
0
)){
return
[
'code'
=>
101
,
'msg'
=>
'暂无权限!'
];
}
return
[];
}
}
/**
/**
* 调整 搜索成交报告id
* 调整 搜索成交报告id
* @return \think\Response
* @return \think\Response
...
...
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