更新 Form.php
增加自定义表单下状态变更的Action缺失
This commit is contained in:
@@ -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("设置失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user