This commit is contained in:
2020-02-17 23:43:41 +08:00
parent 259d232d89
commit 5fb45fc57c
73 changed files with 711 additions and 357 deletions

View File

@@ -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);