From 07006ecb4ec572465e92470f0697d6ebef37954f Mon Sep 17 00:00:00 2001 From: augushong Date: Tue, 21 Apr 2020 10:01:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BD=AE=E9=A1=B6=E6=96=87?= =?UTF-8?q?=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Common.php | 5 +++++ public/static/css/index.articles.css | 13 ++++++++++-- view/admin/system/theme.html | 4 ++-- view/index/common/_articles_right.html | 29 ++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/app/index/controller/Common.php b/app/index/controller/Common.php index c17f6e6..15acaf5 100644 --- a/app/index/controller/Common.php +++ b/app/index/controller/Common.php @@ -4,6 +4,7 @@ namespace app\index\controller; use app\model\Category; use app\model\Nav; +use app\model\Post; use think\facade\View; use think\helper\Str; @@ -50,5 +51,9 @@ class Common extends BaseController $this->assign('list_category_first_level', $list_category_first_level); $list_nav_more = Nav::where('type', 8)->order('sort asc')->where('status', 1)->select(); View::assign('list_nav_more', $list_nav_more); + + $top_posts = Post::where('is_top',1)->limit(8)->select(); + $this->assign('top_posts',$top_posts); + } } diff --git a/public/static/css/index.articles.css b/public/static/css/index.articles.css index 393ef8d..b274c3d 100644 --- a/public/static/css/index.articles.css +++ b/public/static/css/index.articles.css @@ -91,7 +91,7 @@ } -.post-item{ +.post-item,.plus-post-item{ display: flex; justify-content: flex-start; align-items: center; @@ -100,7 +100,7 @@ border-bottom: 1px solid #ddd; } -.post-item .poster{ +.post-item .poster,.plus-post-item .poster{ width: 160px; height: 100px; background-size: cover; @@ -109,6 +109,15 @@ margin-right: 15px; } +.plus-post-item .poster{ + width: 60px; + height: 60px; +} + +.plus-post-item .title{ + font-size: 14px; +} + .post-item .info .title{ font-size: 22px; font-weight: 600; diff --git a/view/admin/system/theme.html b/view/admin/system/theme.html index e6796ba..728a91e 100644 --- a/view/admin/system/theme.html +++ b/view/admin/system/theme.html @@ -48,12 +48,12 @@
-
+
diff --git a/view/index/common/_articles_right.html b/view/index/common/_articles_right.html index 51418e3..2d8d993 100644 --- a/view/index/common/_articles_right.html +++ b/view/index/common/_articles_right.html @@ -12,6 +12,35 @@ +
+
+ 推荐阅读 +
+ +
更多