更新
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 行为管理
|
||||
@@ -26,8 +26,8 @@ class Action extends Admin {
|
||||
$order = "id desc";
|
||||
//获取列表数据
|
||||
$list = model('Action')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
// 记录当前列表页的cookie
|
||||
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
||||
@@ -47,7 +47,7 @@ class Action extends Admin {
|
||||
public function add() {
|
||||
$model = model('Action');
|
||||
if ($this->request->isPost()) {
|
||||
$data = input('post.');
|
||||
$data = input('post.');
|
||||
$result = $model->save($data);
|
||||
if (false != $result) {
|
||||
action_log('add_action', 'Action', $result, session('user_auth.uid'));
|
||||
@@ -72,7 +72,7 @@ class Action extends Admin {
|
||||
public function edit($id = null) {
|
||||
$model = model('Action');
|
||||
if ($this->request->isPost()) {
|
||||
$data = input('post.');
|
||||
$data = input('post.');
|
||||
$result = $model->save($data, array('id' => $data['id']));
|
||||
if ($result !== false) {
|
||||
action_log('edit_action', 'Action', $id, session('user_auth.uid'));
|
||||
@@ -86,7 +86,7 @@ class Action extends Admin {
|
||||
return $this->error("非法操作!");
|
||||
}
|
||||
$data = array(
|
||||
'info' => $info,
|
||||
'info' => $info,
|
||||
'keyList' => $model->fieldlist,
|
||||
);
|
||||
$this->assign($data);
|
||||
@@ -105,7 +105,7 @@ class Action extends Admin {
|
||||
return $this->error("非法操作!", '');
|
||||
}
|
||||
$map['id'] = array('IN', $id);
|
||||
$result = db('Action')->where($map)->delete();
|
||||
$result = db('Action')->where($map)->delete();
|
||||
if ($result) {
|
||||
action_log('delete_action', 'Action', $id, session('user_auth.uid'));
|
||||
return $this->success('删除成功!');
|
||||
@@ -123,10 +123,10 @@ class Action extends Admin {
|
||||
if (empty($id)) {
|
||||
return $this->error("非法操作!", '');
|
||||
}
|
||||
$status = input('get.status', '', 'trim,intval');
|
||||
$message = !$status ? '禁用' : '启用';
|
||||
$status = input('get.status', '', 'trim,intval');
|
||||
$message = !$status ? '禁用' : '启用';
|
||||
$map['id'] = array('IN', $id);
|
||||
$result = db('Action')->where($map)->setField('status', $status);
|
||||
$result = db('Action')->where($map)->setField('status', $status);
|
||||
if ($result !== false) {
|
||||
action_log('setstatus_action', 'Action', $id, session('user_auth.uid'));
|
||||
return $this->success('设置' . $message . '状态成功!');
|
||||
@@ -168,12 +168,12 @@ class Action extends Admin {
|
||||
|
||||
$info = $model::get($id);
|
||||
|
||||
$info['title'] = get_action($info['action_id'], 'title');
|
||||
$info['user_id'] = get_username($info['user_id']);
|
||||
$info['action_ip'] = long2ip($info['action_ip']);
|
||||
$info['title'] = get_action($info['action_id'], 'title');
|
||||
$info['user_id'] = get_username($info['user_id']);
|
||||
$info['action_ip'] = long2ip($info['action_ip']);
|
||||
$info['create_time'] = date('Y-m-d H:i:s', $info['create_time']);
|
||||
$data = array(
|
||||
'info' => $info,
|
||||
$data = array(
|
||||
'info' => $info,
|
||||
'keyList' => $model->keyList,
|
||||
);
|
||||
$this->assign($data);
|
||||
@@ -192,7 +192,7 @@ class Action extends Admin {
|
||||
return $this->error("非法操作!", '');
|
||||
}
|
||||
$map['id'] = array('IN', $id);
|
||||
$res = db('ActionLog')->where($map)->delete();
|
||||
$res = db('ActionLog')->where($map)->delete();
|
||||
if ($res !== false) {
|
||||
action_log('delete_actionlog', 'ActionLog', $id, session('user_auth.uid'));
|
||||
return $this->success('删除成功!');
|
||||
@@ -200,7 +200,7 @@ class Action extends Admin {
|
||||
return $this->error('删除失败!');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 清空日志
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user