mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 00:15:06 +08:00
fix(ProductRepo): 将isset检查改为!empty检查以确保数据有效性
This commit is contained in:
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user