更新功能

This commit is contained in:
2020-02-18 17:24:06 +08:00
parent 0d7635b972
commit 4c036db815
18 changed files with 134 additions and 144 deletions

View File

@@ -6,41 +6,32 @@
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\controller\admin;
use app\controller\Admin;
use app\model\SeoRule;
use app\model\Rewrite;
/**
* @title SEO管理
*/
class Seo extends Admin {
protected $seo;
protected $rewrite;
public function _initialize() {
parent::_initialize();
$this->seo = model('SeoRule');
$this->rewrite = model('Rewrite');
}
/**
* @title SEO列表
*/
public function index($page = 1, $r = 20) {
$map = [];
//读取规则列表
$map = array('status' => array('EGT', 0));
$map[] = ['status', '>=', 0];
$list = $this->seo->where($map)->order('sort asc')->paginate(10, false, array(
'query' => $this->request->param(),
));
$list = SeoRule::where($map)->order('sort asc')->paginate($this->request->pageConfig);
$data = array(
$this->data = [
'list' => $list,
'page' => $list->render(),
);
$this->assign($data);
$this->setMeta("规则列表");
];
return $this->fetch();
}
@@ -111,14 +102,14 @@ class Seo extends Admin {
* @title 伪静态列表
*/
public function rewrite() {
$list = db('Rewrite')->paginate(10);
$map = [];
$data = array(
$list = Rewrite::where($map)->paginate($this->request->pageConfig);
$this->data = [
'list' => $list,
'page' => $list->render(),
);
$this->assign($data);
$this->setMeta("路由规则");
];
return $this->fetch();
}