更新
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 SEO管理
|
||||
@@ -20,7 +20,7 @@ class Seo extends Admin {
|
||||
|
||||
public function _initialize() {
|
||||
parent::_initialize();
|
||||
$this->seo = model('SeoRule');
|
||||
$this->seo = model('SeoRule');
|
||||
$this->rewrite = model('Rewrite');
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ class Seo extends Admin {
|
||||
$map = array('status' => array('EGT', 0));
|
||||
|
||||
$list = $this->seo->where($map)->order('sort asc')->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
@@ -49,7 +49,7 @@ class Seo extends Admin {
|
||||
*/
|
||||
public function add() {
|
||||
if ($this->request->isPost()) {
|
||||
$data = $this->request->post();
|
||||
$data = $this->request->post();
|
||||
$result = $this->seo->save($data);
|
||||
if ($result) {
|
||||
return $this->success("添加成功!");
|
||||
@@ -71,7 +71,7 @@ class Seo extends Admin {
|
||||
*/
|
||||
public function edit($id = null) {
|
||||
if ($this->request->isPost()) {
|
||||
$data = $this->request->post();
|
||||
$data = $this->request->post();
|
||||
$result = $this->seo->save($data, array('id' => $data['id']));
|
||||
if (false !== $result) {
|
||||
return $this->success("修改成功!");
|
||||
@@ -79,10 +79,10 @@ class Seo extends Admin {
|
||||
return $this->error("修改失败!");
|
||||
}
|
||||
} else {
|
||||
$id = input('id', '', 'trim,intval');
|
||||
$id = input('id', '', 'trim,intval');
|
||||
$info = $this->seo->where(array('id' => $id))->find();
|
||||
$data = array(
|
||||
'info' => $info,
|
||||
'info' => $info,
|
||||
'keyList' => $this->seo->keyList,
|
||||
);
|
||||
$this->assign($data);
|
||||
@@ -155,10 +155,10 @@ class Seo extends Admin {
|
||||
return $this->error(model('Rewrite')->getError());
|
||||
}
|
||||
} else {
|
||||
$id = input('id', '', 'trim,intval');
|
||||
$id = input('id', '', 'trim,intval');
|
||||
$info = db('Rewrite')->where(array('id' => $id))->find();
|
||||
$data = array(
|
||||
'info' => $info,
|
||||
'info' => $info,
|
||||
'keyList' => $this->rewrite->keyList,
|
||||
);
|
||||
$this->assign($data);
|
||||
|
||||
Reference in New Issue
Block a user