From 036366af525b409d79929de29de83b775367820f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?k=E5=85=88=E6=A3=AE?= <76847132@qq.com> Date: Wed, 19 Jun 2019 14:44:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Ad.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Ad.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/application/admin/controller/Ad.php b/application/admin/controller/Ad.php index 34c99cb3..5e8b3a29 100644 --- a/application/admin/controller/Ad.php +++ b/application/admin/controller/Ad.php @@ -51,10 +51,15 @@ class Ad extends Admin { $place = model('AdPlace'); if ($this->request->isPost()) { $result = $place->change(); - if ($result) { - return $this->success("添加成功!"); - } else { - return $this->error($place->getError()); + if (!empty($_POST['name'])){ + $result = $place->change(); + if ($result) { + return $this->success("添加成功!"); + } else { + return $this->error($place->getError()); + } + }else{ + return $this->error("标识不能为空!"); } } else { $data = array(