From 73aabb230e34928cfe8d97e7dc35b087fe4bed1a 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 13:56:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Form.php=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E8=A1=A8=E5=8D=95=E4=B8=8B?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=8F=98=E6=9B=B4=E7=9A=84Action=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Form.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/application/admin/controller/Form.php b/application/admin/controller/Form.php index 20a8f9df..9527087e 100644 --- a/application/admin/controller/Form.php +++ b/application/admin/controller/Form.php @@ -273,4 +273,24 @@ class Form extends Admin { array('name' => 'is_must', 'title' => '是否必填', 'help' => '用于自动验证', 'type' => 'select', 'option' => array('0' => '否', '1' => '是')), ); } + /** + * @title 修改状态 + * @author K先森 <77413254@qq.com> + */ + public function status() { + $id = $this->getArrayParam('id'); + $status = input('status', '0', 'trim,intval'); + + if (!$id) { + return $this->error("非法操作!"); + } + + $map['id'] = array('IN', $id); + $result = db('form')->where($map)->setField('status', $status); + if ($result) { + return $this->success("设置成功!"); + } else { + return $this->error("设置失败!"); + } + } } \ No newline at end of file