From 3fbf20e6c7277ea9a8e2f02f3589711b797f2116 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Wed, 14 May 2025 18:06:23 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=A6=96=E9=A1=B5=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Index.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index a94b6c43..efb15f72 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -19,7 +19,6 @@ class Index extends Common */ public function index() { - // 获取banner数据 $banner = $this->getBannerData(); View::assign('focus_images', $banner['focus_images']); @@ -53,7 +52,7 @@ class Index extends Common private function getBannerData() { $banners = SysBannerModel::with(['items' => function($query) { - $query->where('type', '=', 'image')->where('status', '=', 1)->order(['sort' => 'asc', 'id' => 'desc']); + $query->where('type', 'IN', ['image', 'video'])->where('status', '=', 1)->order(['sort' => 'asc', 'id' => 'desc']); }]) ->uniqueLabel([ 'BANNER_67f61cd70e8e1', @@ -72,7 +71,7 @@ class Index extends Common foreach ($banners as $v) { $banner_map[$v->unique_label] = $v; } - + // 处理焦点轮播图和产品分类 $data['focus_images'] = []; // 焦点轮播图 $data['product_categorys'] = []; // 产品分类信息