diff --git a/app/admin/controller/Post.php b/app/admin/controller/Post.php index 7b56ad9..872fa02 100644 --- a/app/admin/controller/Post.php +++ b/app/admin/controller/Post.php @@ -31,10 +31,10 @@ class Post extends Common { // - $list = ModelPost::with(['categorys.category','tags.tag']) - ->where('type',$this->request->param('type',1)) - ->order('id desc') - ->paginate(); + $list = ModelPost::with(['categorys.category', 'tags.tag']) + ->where('type', $this->request->param('type', 1)) + ->order('id desc') + ->paginate(); View::assign('list', $list); @@ -50,6 +50,9 @@ class Post extends Common { // + $list_category = Category::where('status', 1)->order('sort asc')->select(); + + View::assign('list_category', $list_category); return View::fetch(); } @@ -90,7 +93,7 @@ class Post extends Common ]); } - return $this->success('添加成功',url('index',['type'=>$this->request->param('type')])); + return $this->success('添加成功', url('index', ['type' => $this->request->param('type')])); } /** @@ -188,7 +191,7 @@ class Post extends Common } } - return $this->success('保存成功', url('index',['type'=>$model_post->getData('type')])); + return $this->success('保存成功', url('index', ['type' => $model_post->getData('type')])); } /** @@ -205,9 +208,9 @@ class Post extends Common $model_post->delete(); - PostCategory::where('post_id',$id)->delete(); + PostCategory::where('post_id', $id)->delete(); - PostTag::where('post_id',$id)->delete(); + PostTag::where('post_id', $id)->delete(); return json_message(); } diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 804fd1e..5f1b87e 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -18,10 +18,6 @@ class Index extends Common */ public function index($post_id = 0) { - // - - - $list_post = Post::quickSelect(); if (empty($post_id)) { @@ -30,7 +26,6 @@ class Index extends Common $model_post = $list_post->where('id', $post_id)->first(); } - View::assign('model_post', $model_post); View::assign('list_post', $list_post); diff --git a/config/cache.php b/config/cache.php index dd492df..4467583 100644 --- a/config/cache.php +++ b/config/cache.php @@ -1,30 +1,33 @@ Env::get('cache.driver', 'file'), - // 缓存连接方式配置 - 'stores' => [ - 'file' => [ - // 驱动方式 - 'type' => 'File', - // 缓存保存目录 - 'path' => '', - // 缓存前缀 - 'prefix' => '', - // 缓存有效期 0表示永久缓存 - 'expire' => 0, - // 缓存标签前缀 - 'tag_prefix' => 'tag:', - // 序列化机制 例如 ['serialize', 'unserialize'] - 'serialize' => [], - ], - // 更多的缓存连接 +return [ + // 默认缓存驱动 + 'default' => Env::get('cache.driver', 'file'), + + // 缓存连接方式配置 + 'stores' => [ + 'file' => [ + // 驱动方式 + 'type' => 'File', + // 缓存保存目录 + 'path' => App::getRootPath() . 'runtime/cache', + // 缓存前缀 + 'prefix' => '', + // 缓存有效期 0表示永久缓存 + 'expire' => 0, + // 缓存标签前缀 + 'tag_prefix' => 'tag:', + // 序列化机制 例如 ['serialize', 'unserialize'] + 'serialize' => [], ], + // 更多的缓存连接 + ], ]; diff --git a/demo/header.html b/demo/header.html new file mode 100644 index 0000000..d8907fe --- /dev/null +++ b/demo/header.html @@ -0,0 +1,64 @@ +
+ 通用PC头部 +
+
+
+
+ +
+
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+
+ +
+
\ No newline at end of file diff --git a/demo/nav.html b/demo/nav.html new file mode 100644 index 0000000..fd32f56 --- /dev/null +++ b/demo/nav.html @@ -0,0 +1,26 @@ +
+ 一般垂直导航 +
+ +
+
\ No newline at end of file diff --git a/demo/tpl.html b/demo/tpl.html new file mode 100644 index 0000000..f3fc771 --- /dev/null +++ b/demo/tpl.html @@ -0,0 +1,6 @@ +
+ 字段集区块 - 横线风格 +
+ 内容区域 +
+
\ No newline at end of file diff --git a/public/cdn/img/exit.png b/public/cdn/img/exit.png new file mode 100644 index 0000000..a8b8a34 Binary files /dev/null and b/public/cdn/img/exit.png differ diff --git a/public/cdn/layui-ul.css b/public/cdn/layui-ul.css index 3dfd7bb..726959e 100644 --- a/public/cdn/layui-ul.css +++ b/public/cdn/layui-ul.css @@ -1,3 +1,4 @@ +/* 列表开始 */ .ul-nav-tree { border-right: 1px solid #bbb; } @@ -20,14 +21,32 @@ margin-left: 15px; } +/* 列表结束 */ + +/* 通用类开始 */ .ul-padding-md { padding: 15px; } -.ul-avatar-list { - +.ul-section { + margin-bottom: 15px; } +.ul-icon-exit { + display : inline-block; + width : 16px; + height : 16px; + background-image : url('img/exit.png'); + background-size : cover; + background-position: center; +} + +/* 通用类结束 */ + +/* 用户头像开始 */ + +.ul-avatar-list {} + .ul-avatar-list-item { display : flex; align-items : center; @@ -35,9 +54,11 @@ padding : 8px; background-color: #ddd; } -.ul-avatar-list-item.current{ + +.ul-avatar-list-item.current { background-color: #bbb; } + .ul-avatar-list-item-img { height : 48px; width : 48px; @@ -58,7 +79,7 @@ position: absolute; right : 0; top : 0; - color: #999; + color : #999; } .ul-avatar-list-item-tips { @@ -69,4 +90,99 @@ width : 100%; overflow : hidden; text-overflow: ellipsis; -} \ No newline at end of file +} + +/* 头像结束 */ + + +/* 头部开始 */ + +.ul-header { + background-color: #fff; + box-shadow : 0 3px 5px #999; + padding : 3px; +} + +.ul-header-main { + display : flex; + justify-content: space-between; + align-items : center; + margin : 0 auto; +} + +.ul-header-logo { + max-height: 48px; +} + +.ul-header-user { + display : flex; + align-items : center; + justify-content: center; +} + +.ul-header-user-avatar { + background-image : url('/static/images/avatar.png'); + width : 45px; + height : 45px; + background-size : cover; + background-position: center; +} + +.ul-header-user-options { + display : flex; + align-items: center; + color : #999; + font-size : 12px; + cursor : pointer; +} + +.ul-header-user-info { + margin-left: 10px; +} + +/* 头部结束 */ + + +/* 导航开始 */ +.layui-nav.ul-nav-white { + background-color: #f0f0f0; +} + +.layui-nav.ul-nav-white .layui-nav-child a { + color: #666; +} + +.layui-nav.ul-nav-white .layui-nav-item a { + color: #666; +} + +.layui-nav.ul-nav-white .layui-nav-itemed>.layui-nav-child { + background-color: rgba(255, 255, 255, 0.6) !important; +} + +.layui-nav-tree.ul-nav-white .layui-nav-item a:hover { + background-color: #9cf; + color : #fff !important; +} + + +.layui-nav.ul-nav-white .layui-nav-itemed>a, +.layui-nav-tree.ul-nav-white .layui-nav-title a, +.layui-nav-tree.ul-nav-white .layui-nav-title a:hover { + color: #666 !important; +} + +.layui-nav-tree.ul-nav-white .layui-nav-bar { + background-color: #6cf; +} + +.layui-nav-tree.ul-nav-white .layui-nav-child dd.layui-this, +.layui-nav-tree.ul-nav-white .layui-nav-child dd.layui-this a, +.layui-nav-tree.ul-nav-white .layui-this, +.layui-nav-tree.ul-nav-white .layui-this>a, +.layui-nav-tree.ul-nav-white .layui-this>a:hover { + background-color: #9cf; + color : #fff; +} + +/* 导航结束 */ \ No newline at end of file diff --git a/public/static/images/ulthon_logo_108.png b/public/static/images/ulthon_logo_108.png new file mode 100644 index 0000000..a4cef0e Binary files /dev/null and b/public/static/images/ulthon_logo_108.png differ diff --git a/view/admin/post/create.html b/view/admin/post/create.html index 071c5c9..59babb2 100644 --- a/view/admin/post/create.html +++ b/view/admin/post/create.html @@ -139,14 +139,24 @@ - +
+
分类
+
+ +
+
跳转链接
- + + +
跳转链接状态