Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c44ea657
authored
Jan 08, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整获取角色
parent
10350010
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
24 deletions
app/Http/Controllers/PermController.php
app/Http/Controllers/PermController.php
View file @
c44ea657
...
...
@@ -135,40 +135,36 @@
// 根据域名查询系统业务ID
$business
=
$this
->
getBusinessInfo
();
if
(
!
$business
)
return
false
;
$userId
=
array
();
$roleUsers
=
array
();
if
(
$business
)
{
$bid
=
$business
->
bid
;
$role
=
DB
::
table
(
't_role_perm'
)
->
where
([
'bid'
=>
$business
->
bid
,
'name'
=>
$roleName
])
->
first
();
$roleId
=
isset
(
$role
->
roleId
)
?
$role
->
roleId
:
0
;
$role
=
DB
::
table
(
't_role_perm'
)
->
where
([
'bid'
=>
$bid
,
'name'
=>
$roleName
])
->
first
();
// $user = DB::select("SELECT * FROM `t_user_perm` WHERE `bid` = $bid AND `roles` REGEXP $roleId");
$user
=
DB
::
select
(
"SELECT `userId` FROM `t_user_perm` WHERE `bid` =
$business->bid
AND `roles` LIKE '%
\"
"
.
$roleId
.
"
\"
%' ORDER BY `mtime`"
);
$roleId
=
isset
(
$role
->
roleId
)
?
$role
->
roleId
:
0
;
if
(
empty
(
$user
))
return
false
;
// $user = DB::select("SELECT * FROM `t_user_perm` WHERE `bid` = $bid AND `roles` REGEXP $roleId");
$user
=
DB
::
select
(
"SELECT `userId` FROM `t_user_perm` WHERE `bid` =
$bid
AND `roles` LIKE '%
\"
"
.
$roleId
.
"
\"
%' ORDER BY `mtime`"
);
foreach
(
$user
as
$v
)
{
$userId
[]
=
$v
->
userId
;
}
if
(
$user
)
{
foreach
(
$user
as
$v
)
{
$userId
[]
=
$v
->
userId
;
}
if
(
empty
(
$userId
))
return
false
;
if
(
$userId
)
{
foreach
(
$userId
as
$id
)
{
$userInfo
=
DB
::
table
(
'user_info'
)
->
where
(
'userId'
,
$id
)
->
select
(
'userId'
,
'name'
,
'email'
,
'status'
)
->
first
();
foreach
(
$userId
as
$id
)
{
$userInfo
=
DB
::
table
(
'user_info'
)
->
where
(
'userId'
,
$id
)
->
select
(
'userId'
,
'name'
,
'email'
,
'status'
)
->
first
();
if
(
!
$userInfo
)
continue
;
// 判断用户是否已离职 4为离职状态
//
if ($userInfo->status != 4) {
$roleUsers
[]
=
$userInfo
;
//
}
if
(
!
$userInfo
)
continue
;
// 判断用户是否已离职 4为离职状态
if
(
$userInfo
->
status
!=
4
)
{
$roleUsers
[]
=
$userInfo
;
}
continue
;
}
}
}
}
continue
;
}
return
$roleUsers
;
}
...
...
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