From d628e54ef990ee98e01187f67c5ed85f2d07de51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Fri, 21 Apr 2017 14:33:39 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=94=B9=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wechat/controller/Keys.php | 11 ++++++++ application/wechat/view/config.pay.html | 4 +-- application/wechat/view/keys.index.html | 27 +++++++++++-------- composer.lock | 8 +++--- extend/service/WechatService.php | 1 - vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 14 +++++----- vendor/composer/autoload_static.php | 8 +++--- vendor/composer/installed.json | 8 +++--- .../wechat-php-sdk/Wechat/Lib/Tools.php | 1 - 10 files changed, 49 insertions(+), 35 deletions(-) diff --git a/application/wechat/controller/Keys.php b/application/wechat/controller/Keys.php index 3c056aabe..36654da8f 100644 --- a/application/wechat/controller/Keys.php +++ b/application/wechat/controller/Keys.php @@ -66,6 +66,17 @@ class Keys extends BasicAdmin { return $this->_form($this->table, 'form', 'id'); } + + protected function _form_filter($data) { + if ($this->request->isPost() && isset($data['keys'])) { + $db = Db::name($this->table)->where('keys', $data['keys']); + !empty($data['id']) && $db->where('id', 'neq', $data['id']); + if ($db->count() > 0) { + $this->error('关键字已经存在,请使用其它关键字!'); + } + } + } + /** * 删除关键字 */ diff --git a/application/wechat/view/config.pay.html b/application/wechat/view/config.pay.html index 14e5e671c..1d35f1731 100644 --- a/application/wechat/view/config.pay.html +++ b/application/wechat/view/config.pay.html @@ -51,7 +51,7 @@
- -