feat: nas下载页
This commit is contained in:
@@ -177,12 +177,55 @@ class TopicNas extends Common
|
||||
{
|
||||
return View::fetch('help');
|
||||
}
|
||||
|
||||
/**
|
||||
* 专题-Nas帮助中心详情
|
||||
*/
|
||||
public function helpDetail()
|
||||
{
|
||||
|
||||
return View::fetch('help_detail');
|
||||
}
|
||||
|
||||
/**
|
||||
* 专题-Nas软件下载页
|
||||
*/
|
||||
public function download()
|
||||
{
|
||||
$data = [];
|
||||
// 获取banner数据
|
||||
$banners = SysBannerModel::with(['items' => function($query) {
|
||||
$query->withoutField(['sort', 'created_at', 'updated_at', 'deleted_at']);
|
||||
}])
|
||||
->uniqueLabel([
|
||||
'BANNER_6810798e6e828',
|
||||
'BANNER_68107a0a63910',
|
||||
'BANNER_681079cfa83c9',
|
||||
'BANNER_68107a1584238'
|
||||
])
|
||||
->language($this->lang_id)
|
||||
->enabled(true)
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->select();
|
||||
if (!$banners->isEmpty()) {
|
||||
$banners_map = [];
|
||||
foreach ($banners as $banner) {
|
||||
$banners_map[$banner->unique_label] = $banner;
|
||||
}
|
||||
$cyber_image = data_get($banners_map, 'BANNER_6810798e6e828')?->items->first()?->toArray();
|
||||
if (!empty($cyber_image)) $data['cyber']['focus_image'] = $cyber_image;
|
||||
|
||||
$weline_image = data_get($banners_map, 'BANNER_68107a0a63910')?->items->first()?->toArray();
|
||||
if (!empty($weline_image)) $data['weline']['focus_image'] = $weline_image;
|
||||
|
||||
$cyber_down_items = data_get($banners_map, 'BANNER_681079cfa83c9')?->items->toArray();
|
||||
if (!empty($cyber_down_items)) $data['cyber']['down_items'] = $cyber_down_items;
|
||||
|
||||
$weline_down_items = data_get($banners_map, 'BANNER_68107a1584238')?->items->toArray();
|
||||
if (!empty($weline_down_items)) $data['weline']['down_items'] = $weline_down_items;
|
||||
}
|
||||
View::assign('data', $data);
|
||||
|
||||
return View::fetch('download');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user