diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index ab7610d2..a94b6c43 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -19,6 +19,7 @@ class Index extends Common */ public function index() { + // 获取banner数据 $banner = $this->getBannerData(); View::assign('focus_images', $banner['focus_images']); @@ -26,7 +27,14 @@ class Index extends Common View::assign('featured_topics', $banner['featured_topics']); View::assign('video', array_shift($banner['video'])); View::assign('scenes', $banner['scenes']); - View::assign('brand_story', $banner['brand_story']); + View::assign('brand_story', array_map(function($item) { + $item['year'] = ''; + $arr = explode('-', $item['title']); + if (count($arr) > 1) { + $item['year'] = $arr[0]; + } + return $item; + }, $banner['brand_story']??null)); View::assign('data_statistics', $banner['data_statistics']); // 获取明星产品/热点产品 diff --git a/app/index/view/index/index.html b/app/index/view/index/index.html index 9b56b029..4ba629f5 100644 --- a/app/index/view/index/index.html +++ b/app/index/view/index/index.html @@ -167,9 +167,9 @@

- - - + {volist name="brand_story" id="story" key="k"} + {$story.year} + {/volist}