feat: nas客户合作页
This commit is contained in:
@@ -132,6 +132,39 @@ class TopicNas extends Common
|
||||
*/
|
||||
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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user