feat: 品牌介绍

This commit is contained in:
2025-04-22 16:02:02 +08:00
parent b74d20279e
commit 2e27fbde5e
6 changed files with 126 additions and 1 deletions

View File

@@ -12,6 +12,48 @@ use think\facade\View;
*/
class AboutUs extends Common
{
/**
* 品牌介绍
*/
public function introduction()
{
$focus_image = [];
$why = [];
$service = [];
$difference = [];
// 获取品牌介绍banner
$banner = SysBannerModel::with(['items' => function($query) {
$query->withoutField(['status', 'created_at', 'updated_at', 'deleted_at'])
->where('status', '=', 1)
->order(['sort' => 'asc', 'id' => 'desc']);
}])
->uniqueLabel([
"BANNER_680744b1d0000",
"BANNER_680744e7cacb3",
"BANNER_680744fd0998d",
"BANNER_68074513b5d20",
])
->language($this->lang_id)
->enabled(true)
->select();
if (!$banner->isEmpty()) {
$banner_map = [];
foreach ($banner as $v) {
$banner_map[$v->unique_label] = $v;
}
$focus_image = data_get($banner_map, 'BANNER_680744b1d0000')?->items->first()?->toArray();
$why = data_get($banner_map, 'BANNER_680744e7cacb3')?->items->toArray();
$service = data_get($banner_map, 'BANNER_680744fd0998d')?->items->chunk(4)?->toArray();
$difference = data_get($banner_map, 'BANNER_68074513b5d20')?->items->chunk(4)?->toArray();
}
View::assign('focus_image', $focus_image);
View::assign('why', $why);
View::assign('service', $service);
View::assign('difference', $difference);
return View::fetch('introduction');
}
/**
* 品牌故事
*/