From 80aa8fdf17bb379e18ea836a905c4cbbefb88193 Mon Sep 17 00:00:00 2001 From: Anyon Date: Tue, 17 Dec 2019 13:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=9B=9E=E5=A4=8D=E8=A7=84?= =?UTF-8?q?=E5=88=99=E7=8A=B6=E6=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/wechat/controller/Keys.php | 17 +++-------------- app/wechat/view/keys/index.html | 10 +++++----- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/app/wechat/controller/Keys.php b/app/wechat/controller/Keys.php index e9677b7bc..729513153 100644 --- a/app/wechat/controller/Keys.php +++ b/app/wechat/controller/Keys.php @@ -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')]); } /** diff --git a/app/wechat/view/keys/index.html b/app/wechat/view/keys/index.html index f096dc2f6..d9f3e8773 100644 --- a/app/wechat/view/keys/index.html +++ b/app/wechat/view/keys/index.html @@ -66,17 +66,17 @@ {/if} {$vo.create_at|format_datetime} - {if $vo.status eq 0}已禁用{elseif $vo.status eq 1}使用中{/if} + {if $vo.status eq 0}已禁用{elseif $vo.status eq 1}使用中{/if} {if auth("edit")} 编 辑 {/if} - {if $vo.status eq 1 and auth("forbid")} - 禁 用 - {elseif auth("resume")} - 启 用 + {if $vo.status eq 1 and auth("state")} + 禁 用 + {elseif auth("state")} + 启 用 {/if} {if auth("remove")}