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
5bc86d2a
Commit
5bc86d2a
authored
Oct 17, 2018
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业管理员不显示监控币种操作按钮
parent
622c5106
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
CoinPublishController.php
backend/controllers/CoinPublishController.php
+8
-3
list.php
backend/views/coin-publish/list.php
+14
-5
No files found.
backend/controllers/CoinPublishController.php
View file @
5bc86d2a
...
...
@@ -17,13 +17,18 @@ class CoinPublishController extends BaseController
{
public
function
actionList
()
{
$is_show_button
=
false
;
$auth
=
Yii
::
$app
->
authManager
;
$role_self
=
current
(
$auth
->
getRolesByUser
(
Yii
::
$app
->
user
->
id
));
if
(
$role_self
->
name
==
'国盾'
||
Yii
::
$app
->
user
->
id
==
Yii
::
$app
->
params
[
'admin'
])
{
$is_show_button
=
true
;
}
if
(
Yii
::
$app
->
request
->
isAjax
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
$get
=
Yii
::
$app
->
request
->
get
();
$page
=
$get
[
'page'
]
??
1
;
$limit
=
$get
[
'limit'
]
??
10
;
$auth
=
Yii
::
$app
->
authManager
;
$role_self
=
current
(
$auth
->
getRolesByUser
(
Yii
::
$app
->
user
->
id
));
$child_roles
=
$auth
->
getChildRoles
(
$role_self
->
name
);
$userful_roles
=
array_keys
(
$child_roles
);
$condition
[]
=
[
'in'
,
'owner'
,
$userful_roles
];
...
...
@@ -38,7 +43,7 @@ class CoinPublishController extends BaseController
}
return
$data
;
}
return
$this
->
render
(
'list'
);
return
$this
->
render
(
'list'
,
[
'is_show_button'
=>
$is_show_button
]
);
}
public
function
actionAdd
()
...
...
backend/views/coin-publish/list.php
View file @
5bc86d2a
<?php
/**
* Created By Sublime text 3
*
* @author rlgzyhcn <rlgyzhcn@qq.com>
*/
use
backend\assets\coinPublish\IndexAsset
;
IndexAsset
::
register
(
$this
);
?>
<h4>
发币管理
</h4>
<div
class=
"layui-row"
>
<button
class=
"layui-btn"
id=
"add"
>
添加币种监控
</button>
</div>
<?php
if
(
$is_show_button
)
:
?>
<div
class=
"layui-row"
>
<button
class=
"layui-btn"
id=
"add"
>
添加币种监控
</button>
</div>
<?php
endif
;
?>
<div
class=
"layui-row"
>
<div
class=
"layui-table"
id=
"table1"
lay-filter=
"table1"
></div>
</div>
<script
type=
"text/html"
id=
"toolbar"
>
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"update"
>
编辑
<
/a
>
<?php
if
(
$is_show_button
)
:
?>
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"update"
>
编辑
<
/a
>
<?php
endif
;
?>
<
a
class
=
"layui-btn layui-btn-xs"
href
=
"/admin/coin-publish-rule/list?pid={{d.id}}"
>
查看配置
<
/a
>
<
a
class
=
"layui-btn layui-btn-danger layui-btn-xs"
lay
-
event
=
"del"
>
删除
<
/a
>
<?php
if
(
$is_show_button
)
:
?>
<
a
class
=
"layui-btn layui-btn-danger layui-btn-xs"
lay
-
event
=
"del"
>
删除
<
/a
>
<?php
endif
;
?>
</script>
\ No newline at end of file
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