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