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
8586a7e8
Commit
8586a7e8
authored
Nov 15, 2019
by
张晓林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取用户组
parent
932c8bc3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
ShopUserListController.php
backend/controllers/v1/shopuser/ShopUserListController.php
+11
-2
No files found.
backend/controllers/v1/shopuser/ShopUserListController.php
View file @
8586a7e8
...
@@ -40,12 +40,15 @@ class ShopUserListController extends BaseController
...
@@ -40,12 +40,15 @@ class ShopUserListController extends BaseController
$param
=
Yii
::
$app
->
request
->
get
();
$param
=
Yii
::
$app
->
request
->
get
();
$ShopUserList
=
new
ShopUserList
();
$ShopUserList
=
new
ShopUserList
();
$userList
=
$ShopUserList
->
getUserList
(
$param
);
$userList
=
$ShopUserList
->
getUserList
(
$param
);
$data
[
'userList'
]
=
$userList
;
//获取所有用户组
$data
[
'memberGradeList'
]
=
$this
->
getMemberGradeList
();
if
(
empty
(
$userList
)){
if
(
empty
(
$userList
)){
throw
new
BadRequestHttpException
(
'未找到查询数据'
);
throw
new
BadRequestHttpException
(
'未找到查询数据'
);
}
}
return
[
return
[
'CODE'
=>
200
,
'CODE'
=>
200
,
'DATA'
=>
$
userList
'DATA'
=>
$
data
];
];
}
}
...
@@ -83,7 +86,7 @@ class ShopUserListController extends BaseController
...
@@ -83,7 +86,7 @@ class ShopUserListController extends BaseController
];
];
$data
[
'userInfo'
]
=
$model
::
find
()
->
select
(
$userColumn
)
->
where
([
'GUID'
=>
$param
[
'GUID'
]])
->
asArray
()
->
one
();
$data
[
'userInfo'
]
=
$model
::
find
()
->
select
(
$userColumn
)
->
where
([
'GUID'
=>
$param
[
'GUID'
]])
->
asArray
()
->
one
();
//获取所有用户组
//获取所有用户组
$data
[
'memberGradeList'
]
=
ShopUserMembergrade
::
find
()
->
select
([
'GUID'
,
'NAME'
])
->
asArray
()
->
all
();
$data
[
'memberGradeList'
]
=
$this
->
getMemberGradeList
();
//获取用户所在用户组
//获取用户所在用户组
if
(
!
empty
(
$data
[
'userInfo'
])){
if
(
!
empty
(
$data
[
'userInfo'
])){
$data
[
'userMemberGradeList'
]
=
$model
::
find
()
$data
[
'userMemberGradeList'
]
=
$model
::
find
()
...
@@ -139,4 +142,10 @@ class ShopUserListController extends BaseController
...
@@ -139,4 +142,10 @@ class ShopUserListController extends BaseController
public
function
actionUserUpdate
(){
public
function
actionUserUpdate
(){
}
}
public
function
getMemberGradeList
(){
//获取所有用户组
$list
=
ShopUserMembergrade
::
find
()
->
select
([
'GUID'
,
'NAME'
])
->
asArray
()
->
all
();
return
$list
;
}
}
}
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