mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 03:35: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);
|
$result = Json::decode($content);
|
||||||
|
|
||||||
return new RechargeProduct(
|
return new RechargeProduct(
|
||||||
oneTime: isset($result['one_time'])
|
oneTime: !empty($result['one_time'])
|
||||||
? new ProductItem(
|
? new ProductItem(
|
||||||
id: $result['one_time']['id'],
|
id: $result['one_time']['id'],
|
||||||
description: $result['one_time']['name'],
|
description: $result['one_time']['name'],
|
||||||
@@ -164,7 +164,7 @@ final class ProductRepo extends AbstractRepo implements RechargeProductRepoInter
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
renew: isset($result['renew'])
|
renew: !empty($result['renew'])
|
||||||
? new ProductItem(
|
? new ProductItem(
|
||||||
id: $result['renew']['id'],
|
id: $result['renew']['id'],
|
||||||
description: $result['renew']['name'],
|
description: $result['renew']['name'],
|
||||||
|
|||||||
Reference in New Issue
Block a user