合并回复规则状态修改

This commit is contained in:
Anyon 2019-12-17 13:52:33 +08:00
parent c04364f865
commit 80aa8fdf17
2 changed files with 8 additions and 19 deletions

View File

@ -121,25 +121,14 @@ class Keys extends Controller
}
/**
* 禁用回复规则
* 修改回复规则状态
* @auth true
* @throws \think\db\exception\DbException
*/
public function forbid()
public function state()
{
$this->_applyFormToken();
$this->_save($this->table, ['status' => '0']);
}
/**
* 启用回复规则
* @auth true
* @throws \think\db\exception\DbException
*/
public function resume()
{
$this->_applyFormToken();
$this->_save($this->table, ['status' => '1']);
$this->_save($this->table, ['status' => input('status')]);
}
/**

View File

@ -66,17 +66,17 @@
{/if}
</td>
<td class="text-left nowrap">{$vo.create_at|format_datetime}</td>
<td class='text-left nowrap'>{if $vo.status eq 0}<span class="color-desc">已禁用</span>{elseif $vo.status eq 1}<span class="color-green">使用中</span>{/if}</td>
<td class='text-left nowrap'>{if $vo.status eq 0}<span class="color-red">已禁用</span>{elseif $vo.status eq 1}<span class="color-green">使用中</span>{/if}</td>
<td class='text-left nowrap'>
{if auth("edit")}
<a class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
{/if}
{if $vo.status eq 1 and auth("forbid")}
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('forbid')}">禁 用</a>
{elseif auth("resume")}
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('resume')}">启 用</a>
{if $vo.status eq 1 and auth("state")}
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('state')}">禁 用</a>
{elseif auth("state")}
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('state')}">启 用</a>
{/if}
{if auth("remove")}