Commit 5bc86d2a authored by rlgy's avatar rlgy

企业管理员不显示监控币种操作按钮

parent 622c5106
......@@ -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()
......
<?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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment