From 7ade038f0fb1c6a857428d75667ccb2289d392fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=9C=E4=BA=91?= Date: Wed, 24 Dec 2025 14:11:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(ProductRepo):=20=E5=B0=86isset=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=94=B9=E4=B8=BA!empty=E6=A3=80=E6=9F=A5=E4=BB=A5?= =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E6=95=B0=E6=8D=AE=E6=9C=89=E6=95=88=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Infrastructure/Repository/ProductRepo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/Repository/ProductRepo.php b/src/Infrastructure/Repository/ProductRepo.php index 01ba756..d66b65b 100644 --- a/src/Infrastructure/Repository/ProductRepo.php +++ b/src/Infrastructure/Repository/ProductRepo.php @@ -148,7 +148,7 @@ final class ProductRepo extends AbstractRepo implements RechargeProductRepoInter $result = Json::decode($content); return new RechargeProduct( - oneTime: isset($result['one_time']) + oneTime: !empty($result['one_time']) ? new ProductItem( id: $result['one_time']['id'], description: $result['one_time']['name'], @@ -164,7 +164,7 @@ final class ProductRepo extends AbstractRepo implements RechargeProductRepoInter ), ) : null, - renew: isset($result['renew']) + renew: !empty($result['renew']) ? new ProductItem( id: $result['renew']['id'], description: $result['renew']['name'],