Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
wallet
token
Commits
b6e469e8
Commit
b6e469e8
authored
Nov 09, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
列表排序
parent
6edafced
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
AuthController.php
backend/controllers/AuthController.php
+13
-2
index.php
backend/views/auth/index.php
+4
-4
No files found.
backend/controllers/AuthController.php
View file @
b6e469e8
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
backend\controllers
;
namespace
backend\controllers
;
use
common\components\Tools
;
use
common\models\psources\CoinPlatform
;
use
common\models\psources\CoinPlatform
;
use
Yii
;
use
Yii
;
use
common\models\Admin
;
use
common\models\Admin
;
...
@@ -47,9 +48,19 @@ class AuthController extends BaseController
...
@@ -47,9 +48,19 @@ class AuthController extends BaseController
/* 获取角色列表 */
/* 获取角色列表 */
$self_roles
=
current
(
$auth
->
getRolesByUser
(
Yii
::
$app
->
user
->
id
));
$self_roles
=
current
(
$auth
->
getRolesByUser
(
Yii
::
$app
->
user
->
id
));
$roles
=
$auth
->
getChildRoles
(
$self_roles
->
name
);
$roles
=
$auth
->
getChildRoles
(
$self_roles
->
name
);
$roles_temp
=
[];
foreach
(
$roles
as
$key
=>
$role
)
{
$roles_temp
[
$role
->
name
][
'type'
]
=
$role
->
type
;
$roles_temp
[
$role
->
name
][
'name'
]
=
$role
->
name
;
$roles_temp
[
$role
->
name
][
'description'
]
=
$role
->
description
;
$roles_temp
[
$role
->
name
][
'ruleName'
]
=
$role
->
ruleName
;
$roles_temp
[
$role
->
name
][
'data'
]
=
$role
->
data
;
$roles_temp
[
$role
->
name
][
'createdAt'
]
=
$role
->
createdAt
;
$roles_temp
[
$role
->
name
][
'updatedAt'
]
=
$role
->
updatedAt
;
}
$roles_temp
=
Tools
::
arraySort
(
$roles_temp
,
'createdAt'
);
return
$this
->
render
(
'index'
,
[
return
$this
->
render
(
'index'
,
[
'roles'
=>
$roles
,
'roles'
=>
$roles
_temp
,
]);
]);
}
}
...
...
backend/views/auth/index.php
View file @
b6e469e8
...
@@ -32,10 +32,10 @@ use yii\helpers\Url;
...
@@ -32,10 +32,10 @@ use yii\helpers\Url;
<tr
class=
"odd gradeX"
>
<tr
class=
"odd gradeX"
>
<?php
$nn
++
;
?>
<?php
$nn
++
;
?>
<td>
<?=
$nn
?>
</td>
<td>
<?=
$nn
?>
</td>
<td
style =
'white-space: nowrap;'
>
<?=
$value
->
name
?>
</td>
<td
style =
'white-space: nowrap;'
>
<?=
$value
[
'name'
]
?>
</td>
<td
style =
'white-space: nowrap;'
>
<?=
$value
->
description
?>
</td>
<td
style =
'white-space: nowrap;'
>
<?=
$value
[
'description'
]
?>
</td>
<td
style =
'white-space: nowrap;'
>
<?=
date
(
'Y-m-d H:i'
,
$value
->
createdAt
)
?>
</td>
<td
style =
'white-space: nowrap;'
>
<?=
date
(
'Y-m-d H:i'
,
$value
[
'createdAt'
]
)
?>
</td>
<td
style =
'white-space: nowrap;'
>
<?=
date
(
'Y-m-d H:i'
,
$value
->
updatedAt
)
?>
</td>
<td
style =
'white-space: nowrap;'
>
<?=
date
(
'Y-m-d H:i'
,
$value
[
'updatedAt'
]
)
?>
</td>
<td
style =
'white-space: nowrap;'
>
<td
style =
'white-space: nowrap;'
>
<a
href=
"
<?=
Url
::
toRoute
([
'edit'
,
'role'
=>
$key
])
?>
"
class=
"btn btn-xs blue"
><i
class=
"fa fa-edit"
></i>
编辑
</a>
<a
href=
"
<?=
Url
::
toRoute
([
'edit'
,
'role'
=>
$key
])
?>
"
class=
"btn btn-xs blue"
><i
class=
"fa fa-edit"
></i>
编辑
</a>
<a
href=
"
<?=
Url
::
toRoute
([
'auth'
,
'role'
=>
$key
])
?>
"
class=
"btn btn-xs blue"
><i
class=
"icon-key"
></i>
授权
</a>
<a
href=
"
<?=
Url
::
toRoute
([
'auth'
,
'role'
=>
$key
])
?>
"
class=
"btn btn-xs blue"
><i
class=
"icon-key"
></i>
授权
</a>
...
...
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