diff --git a/app/controller/admin/Form.php b/app/controller/admin/Form.php index 7c0c5ae5..81ec3861 100644 --- a/app/controller/admin/Form.php +++ b/app/controller/admin/Form.php @@ -272,7 +272,7 @@ class Form extends Base { * @author K先森 <77413254@qq.com> */ public function status() { - $id = $this->getArrayParam('id'); + $id = $this->request->param('form_id', 0); $status = input('status', '0', 'trim,intval'); if (!$id) { @@ -280,7 +280,7 @@ class Form extends Base { } $map['id'] = array('IN', $id); - $result = db('form')->where($map)->setField('status', $status); + $result = FormM::where($map)->update(['status'=>$status]); if ($result) { return $this->success("设置成功!"); } else { diff --git a/view/admin/model/index.html b/view/admin/model/index.html index c37f4bd2..c935ddb9 100644 --- a/view/admin/model/index.html +++ b/view/admin/model/index.html @@ -51,7 +51,12 @@ {$item['status'] ? '禁用' : '启用'} 编辑 删除 - 数据 + + {if $item['status']} + 数据 + {else} + 数据 + {/if} {/volist}