From b7982c5db08f4c862d68116b54349502abe47372 Mon Sep 17 00:00:00 2001 From: Anyon Date: Wed, 3 May 2017 17:32:35 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=94=B9=E7=B2=89?= =?UTF-8?q?=E4=B8=9D=E6=A0=87=E7=AD=BE=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + application/admin/controller/Menu.php | 2 -- application/wechat/controller/Tags.php | 9 +++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 39527fde3..b7caae401 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Think.Admin ``` Options +FollowSymlinks -Multiviews + RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f diff --git a/application/admin/controller/Menu.php b/application/admin/controller/Menu.php index 5a56fd3a3..06fd40046 100644 --- a/application/admin/controller/Menu.php +++ b/application/admin/controller/Menu.php @@ -101,8 +101,6 @@ class Menu extends BasicAdmin { } $this->assign('nodes', array_column($nodes, 'node')); $this->assign('menus', $menus); - } else { - $this->error('请不要改菜单构造!'); } } diff --git a/application/wechat/controller/Tags.php b/application/wechat/controller/Tags.php index bfed7cc3d..0cf10d899 100644 --- a/application/wechat/controller/Tags.php +++ b/application/wechat/controller/Tags.php @@ -58,6 +58,15 @@ class Tags extends BasicAdmin { if ($this->request->isGet()) { return parent::_form($this->table, 'form', 'id'); } + $name = $this->request->post('name', ''); + empty($name) && $this->error('粉丝标签名不能为空!'); + if (Db::name($this->table)->where('name', $name)->count() > 0) { + $this->error('粉丝标签标签名已经存在,请使用其它标签名!'); + } + $result = DataService::save($this->table, ['name' => $name, 'count' => 0]); + empty($result) && $this->error('粉丝标签添加失败,请稍候再试!'); + $info = Db::name($this->table)->where('name', $name)->find(); + empty($info) && $this->error('粉丝标签添加失败,请稍候再试!'); } /**