From 86b3ebcf072957d2b7d7f47a6c792c324846ff79 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Sat, 7 Jun 2025 14:27:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=A7=E5=93=81=E5=88=86=E7=B1=BBbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Product.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/index/controller/Product.php b/app/index/controller/Product.php index 666043a4..c1db50be 100644 --- a/app/index/controller/Product.php +++ b/app/index/controller/Product.php @@ -253,7 +253,11 @@ class Product extends Common ]; } foreach ($categorys_data as $k => $v) { - $categorys_data[$k]['products'] = $products_map[$v['id']] ?? []; + if (!isset($products_map[$v['id']])) { + unset($categorys_data[$k]); + continue; + } + $categorys_data[$k]['products'] = $products_map[$v['id']]; } } }