From 3d9aa3e74215fc1015afbc94daf4febf2b1d0bd6 Mon Sep 17 00:00:00 2001 From: molong Date: Sat, 6 Jul 2019 21:22:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/admin/Database.php | 10 ++++++++-- app/controller/admin/Seo.php | 23 ++++++++++++++++++++--- app/model/Rewrite.php | 8 ++++++++ app/model/SeoRule.php | 8 ++++++++ app/view/admin/database/import.html | 14 +++++++------- 5 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 app/model/Rewrite.php create mode 100644 app/model/SeoRule.php diff --git a/app/controller/admin/Database.php b/app/controller/admin/Database.php index 55111d0d..ac05be5e 100644 --- a/app/controller/admin/Database.php +++ b/app/controller/admin/Database.php @@ -16,12 +16,18 @@ class Database extends Admin{ * @title 数据备份 */ public function export(){ - + $this->data['data'] = array( + 'list' => array() + ); + return $this->data; } /** * @title 数据导入 */ public function import(){ - + $this->data['data'] = array( + 'list' => array() + ); + return $this->data; } } \ No newline at end of file diff --git a/app/controller/admin/Seo.php b/app/controller/admin/Seo.php index d69a80de..c35e2947 100644 --- a/app/controller/admin/Seo.php +++ b/app/controller/admin/Seo.php @@ -9,20 +9,37 @@ namespace app\controller\admin; use app\controller\Admin; +use app\model\Rewrite; +use app\model\SeoRule; class Seo extends Admin{ /** * @title 系统首页 */ - public function index(){ + public function index(SeoRule $seo){ + //读取规则列表 + $map = array('status' => array('=', 0)); + $list = $seo->where($map)->order('sort asc')->paginate(10, false, array( + 'query' => $this->request->param() + )); + + $this->data['data'] = array( + 'list' => $list, + 'page' => $list->render() + ); + + return $this->data; } /** * @title 重写规则 */ - public function rewrite(){ - + public function rewrite(Rewrite $rewrite){ + $this->data['data'] = array( + 'list' => array() + ); + return $this->data; } } \ No newline at end of file diff --git a/app/model/Rewrite.php b/app/model/Rewrite.php new file mode 100644 index 00000000..9753801c --- /dev/null +++ b/app/model/Rewrite.php @@ -0,0 +1,8 @@ + - {volist name="list" id="data"} + {volist name="list" id="item"} - {$data.time|date='Ymd-His',###} - {$data.part} - {$data.compress} - {$data.size|format_bytes} + {$item['time']|date='Ymd-His',###} + {$item['part']} + {$item['compress']} + {$item['size']|format_bytes} {$key} - - 还原 + 还原   - 删除 + 删除 {/volist}