@@ -51,10 +51,15 @@ class Ad extends Admin {
|
||||
$place = model('AdPlace');
|
||||
if ($this->request->isPost()) {
|
||||
$result = $place->change();
|
||||
if (false !== false) {
|
||||
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(
|
||||
|
||||
@@ -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