Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopBack
Project
Project
Details
Activity
Releases
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
newshop
newShopBack
Commits
b2fb5e1a
Commit
b2fb5e1a
authored
Dec 02, 2019
by
郭勇志
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据用户guid取得用户等级,所属省级,所属门店
parent
9b072430
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
ShopRbacUser.php
backend/models/v1/rbacuser/ShopRbacUser.php
+17
-0
No files found.
backend/models/v1/rbacuser/ShopRbacUser.php
View file @
b2fb5e1a
...
@@ -190,4 +190,21 @@ class ShopRbacUser extends BaseModel implements IdentityInterface
...
@@ -190,4 +190,21 @@ class ShopRbacUser extends BaseModel implements IdentityInterface
{
{
return
$this
->
hasOne
(
ShopRbacRoleUser
::
className
(),
[
'USER_ID'
=>
'GUID'
]);
return
$this
->
hasOne
(
ShopRbacRoleUser
::
className
(),
[
'USER_ID'
=>
'GUID'
]);
}
}
/**
* 根据用户guid取得用户等级,所属省级,所属门店
*
* @param string $userGuid
* @return array
*/
public
function
getRbacUserInfo
(
$userGuid
)
{
return
$this
->
find
()
->
alias
(
'sru'
)
->
select
(
'sru.GUID,sb.CODE as BRANCH_CODE,sb.GUID as BRANCH_GUID,sb.PARENT_GUID as PARENT_BRANCH_GUID,sb.BRANCH_TYPE,sb.SUPPROVINCE_GUID,srru.ROLE_ID'
)
->
leftJoin
(
'shop_rbac_role_user srru'
,
'srru.USER_ID=sru.GUID'
)
->
leftJoin
(
'shop_branch sb'
,
'sb.GUID=sru.BRANCH_GUID'
)
->
where
([
'sru.GUID'
=>
$userGuid
])
->
asArray
()
->
one
();
}
}
}
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