refactor: 首页品牌故事年份显示问题
This commit is contained in:
@@ -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']);
|
||||
|
||||
// 获取明星产品/热点产品
|
||||
|
||||
Reference in New Issue
Block a user