189 lines
6.5 KiB
PHP
189 lines
6.5 KiB
PHP
<?php
|
|
declare (strict_types = 1);
|
|
|
|
namespace app\index\controller;
|
|
|
|
use app\index\model\SysBannerModel;
|
|
use think\facade\View;
|
|
|
|
/**
|
|
* 专题-Nas控制器
|
|
*/
|
|
class TopicNas extends Common
|
|
{
|
|
/**
|
|
* 重写控制器初始化
|
|
*/
|
|
protected function initialize()
|
|
{
|
|
// 获取国家/语言列表
|
|
$languages = $this->getLanguages();
|
|
|
|
// 获取当前语言
|
|
$current_language = $this->getCurrentLanguage($languages);
|
|
if (!empty($current_language)) {
|
|
$this->lang_id = $current_language['id'];
|
|
}
|
|
|
|
// 获取产品分类
|
|
$categorys = $this->getProductCategory($this->lang_id);
|
|
// 输出产品分类
|
|
View::assign('header_categorys', $categorys);
|
|
|
|
// 输出顶部导航
|
|
View::assign('header_navigation', $this->getNavigation('NAV_680ef95e9db90', $this->lang_id));
|
|
|
|
// 获取系统配置
|
|
$configs = $this->getSysConfig($this->lang_id, ['basic', 'contact', 'media']);
|
|
$this->basic_config = $configs['basic'];
|
|
// 输出系统配置
|
|
View::assign('basic_config', $configs['basic']);
|
|
View::assign('contact_config', $configs['contact']);
|
|
View::assign('media_config', $configs['media']);
|
|
|
|
// 获取底部导航
|
|
$footer_navigation = $this->getNavigation('NAV_67f60be43df8d', $this->lang_id);
|
|
// 输出底部导航
|
|
View::assign('footer_navigation', $footer_navigation);
|
|
}
|
|
|
|
/**
|
|
* 专题-Nas首页
|
|
*/
|
|
public function index()
|
|
{
|
|
$focus_image = [];
|
|
$nas_category = [];
|
|
$nas_video = [];
|
|
$nas_solution = [];
|
|
$nas_software = [];
|
|
// 获取banner数据
|
|
$banners = SysBannerModel::with(['items' => function($query) {
|
|
$query->withoutField(['sort', 'created_at', 'updated_at', 'deleted_at']);
|
|
}])
|
|
->uniqueLabel([
|
|
'BANNER_680f156a805a8',
|
|
'BANNER_680f15ca5482f',
|
|
'BANNER_680f161b5fd3a',
|
|
'BANNER_680f16358f14c',
|
|
'BANNER_680f1e5132184'
|
|
])
|
|
->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;
|
|
}
|
|
$focus_image = data_get($banners_map, 'BANNER_680f156a805a8')?->items->toArray();
|
|
$nas_category = data_get($banners_map, 'BANNER_680f15ca5482f')?->items->chunk(3)?->toArray();
|
|
$nas_video = data_get($banners_map, 'BANNER_680f161b5fd3a')?->items->first()?->toArray();
|
|
$nas_solution = data_get($banners_map, 'BANNER_680f16358f14c')?->items->toArray();
|
|
$nas_software = data_get($banners_map, 'BANNER_680f1e5132184')?->items->toArray();
|
|
}
|
|
View::assign('focus_image', $focus_image);
|
|
View::assign('nas_category', $nas_category);
|
|
View::assign('nas_video', $nas_video);
|
|
View::assign('nas_solution', $nas_solution);
|
|
View::assign('nas_software', $nas_software);
|
|
|
|
return View::fetch('index');
|
|
}
|
|
|
|
/**
|
|
* 专题-Nas产品体验页
|
|
*/
|
|
public function product()
|
|
{
|
|
$focus_image = [];
|
|
$step = [];
|
|
$trial_instructions = [];
|
|
// 获取banner数据
|
|
$banners = SysBannerModel::with(['items' => function($query) {
|
|
$query->withoutField(['sort', 'created_at', 'updated_at', 'deleted_at']);
|
|
}])
|
|
->uniqueLabel([
|
|
'BANNER_68103aaebe4c4',
|
|
'BANNER_68103acd1a8b9',
|
|
'BANNER_68103daed6623'
|
|
])
|
|
->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;
|
|
}
|
|
$focus_image = data_get($banners_map, 'BANNER_68103aaebe4c4')?->items->first()?->toArray();
|
|
$step = data_get($banners_map, 'BANNER_68103acd1a8b9')?->items->toArray();
|
|
$trial_instructions = data_get($banners_map, 'BANNER_68103daed6623')?->items->toArray();
|
|
}
|
|
View::assign('focus_image', $focus_image);
|
|
View::assign('step', $step);
|
|
View::assign('trial_instructions', $trial_instructions);
|
|
|
|
return View::fetch('product');
|
|
}
|
|
|
|
/**
|
|
* 专题-Nas客户合作页
|
|
*/
|
|
public function cooperation()
|
|
{
|
|
$focus_image = [];
|
|
$cooperation_methods = [];
|
|
$cooperation_advantages = [];
|
|
$cooperation_cotacts = [];
|
|
// 获取banner数据
|
|
$banners = SysBannerModel::with(['items' => function($query) {
|
|
$query->withoutField(['sort', 'created_at', 'updated_at', 'deleted_at']);
|
|
}])
|
|
->uniqueLabel([
|
|
'BANNER_6810670b8ef17',
|
|
'BANNER_681067451b78f',
|
|
'BANNER_6810685ab7c6c',
|
|
'BANNER_681068ab73073'
|
|
])
|
|
->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;
|
|
}
|
|
$focus_image = data_get($banners_map, 'BANNER_6810670b8ef17')?->items->first()?->toArray();
|
|
$cooperation_methods = data_get($banners_map, 'BANNER_681067451b78f')?->items->toArray();
|
|
$cooperation_advantages = data_get($banners_map, 'BANNER_6810685ab7c6c')?->items->toArray();
|
|
$cooperation_cotacts = data_get($banners_map, 'BANNER_681068ab73073')?->items->chunk(3)?->toArray();
|
|
}
|
|
View::assign('focus_image', $focus_image);
|
|
View::assign('cooperation_methods', $cooperation_methods);
|
|
View::assign('cooperation_advantages', $cooperation_advantages);
|
|
View::assign('cooperation_cotacts', $cooperation_cotacts);
|
|
|
|
return View::fetch('cooperation');
|
|
}
|
|
|
|
/**
|
|
* 专题-Nas帮助中心页
|
|
*/
|
|
public function help()
|
|
{
|
|
return View::fetch('help');
|
|
}
|
|
|
|
/**
|
|
* 专题-Nas软件下载页
|
|
*/
|
|
public function download()
|
|
{
|
|
return View::fetch('download');
|
|
}
|
|
}
|