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