From 7f6844207e224a5da8085c6839b718ab6bc06db7 Mon Sep 17 00:00:00 2001 From: zwesy Date: Mon, 7 Dec 2020 18:45:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E3=80=81=E4=BA=A7=E5=93=81=E7=AD=89=E9=A1=B5=E9=9D=A2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/Article.php | 6 +++++- app/controller/Index.php | 10 ++++++++-- public/static/css/style.css | 2 ++ view/article/news.html | 2 ++ view/article/news_center.html | 2 +- view/article/products.html | 2 ++ view/index/index.html | 8 +++++--- 7 files changed, 25 insertions(+), 7 deletions(-) diff --git a/app/controller/Article.php b/app/controller/Article.php index c399c78..f8fbb77 100644 --- a/app/controller/Article.php +++ b/app/controller/Article.php @@ -123,7 +123,11 @@ class Article extends Base $cateList = []; $newsChildrenFlip = array_flip(Category::$CIdList['news_children']); foreach ($categoryChildren as $cate) { - $cate['items'] = MArticle::getLatestByCategory($cate['id'], 4, 1); + $num = 3; + if($cate['id'] == Category::$CIdList['news_children']['dynamics']) { + $num = 4; + } + $cate['items'] = MArticle::getLatestByCategory($cate['id'], $num, 1); $cateList[$newsChildrenFlip[$cate['id']]] = $cate; } $this->data['cateList'] = $cateList; diff --git a/app/controller/Index.php b/app/controller/Index.php index 9c0b93a..ff394ad 100644 --- a/app/controller/Index.php +++ b/app/controller/Index.php @@ -19,9 +19,15 @@ class Index extends Base // 网络营销栏目ID $this->data['marketingCId'] = Category::$CIdList['marketing']; // 关联产品中心 + $productsCId = Category::$CIdList['products']; + $productChildren = Category::getChildrenByParentId($productsCId); + $productsCIds[] = $productsCId; + foreach ($productChildren as $cate) { + $productsCIds[] = $cate['id']; + } $this->data['products'] = [ - 'category' => Category::getById(Category::$CIdList['products']), - 'items' => Article::getLatestByCategory(Category::$CIdList['products'], 4, 1) + 'category' => Category::getById($productsCId), + 'items' => Article::getListByCategoryIds($productsCIds, 4, '', [], 1, ['create_time'=>'desc']) ]; // 关联新闻 $this->data['newsCenter'] = Category::getById(Category::$CIdList['news']); diff --git a/public/static/css/style.css b/public/static/css/style.css index 54baa5a..ff04e6e 100644 --- a/public/static/css/style.css +++ b/public/static/css/style.css @@ -248,8 +248,10 @@ input,select,textarea{outline:medium none; resize: none;} .service-box3 .box-info .pull-right ul li .info{ width: 100%; padding-left: 5.625rem; font-size: 15px; color: #999; line-height: 1.8;} .service-box3 .box-info .pull-right ul li .info strong{ color: #555;} .service-box3 .box-info .pull-right ul li .info i{ font-size: 36px; color: #00418f; font-weight: bold;} +/* .service-box3 .box-info .pull-right::before{ content: ''; width: 3.125rem; height: 3.125rem; border-top: 0.25rem solid #ccc; border-left: 0.25rem solid #ccc; position: absolute; left: 0; top: 0;} .service-box3 .box-info .pull-right::after{ content: ''; width: 3.125rem; height: 3.125rem; border-bottom: 0.25rem solid #ccc; border-right: 0.25rem solid #ccc; position: absolute; right: 0; bottom: 0;} +*/ .marketing-box1{ padding: 10rem 0 0;} .marketing-box1 .box-info{ padding-bottom: 4.5rem;} diff --git a/view/article/news.html b/view/article/news.html index 6ec5c32..27e02b9 100644 --- a/view/article/news.html +++ b/view/article/news.html @@ -12,12 +12,14 @@