mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 06:15:09 +08:00
fix(goods): 修复类型错误的问题
This commit is contained in:
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Singularity\HDK\Pay\Resource;
|
||||
|
||||
use Hyperf\Resource\Json\JsonResource;
|
||||
use Money\Currency;
|
||||
use Money\Money;
|
||||
|
||||
/**
|
||||
@@ -39,7 +40,7 @@ final class Goods extends JsonResource
|
||||
'id' => $this->id,
|
||||
'goodsName' => $this->goodsName,
|
||||
'goodsSpec' => $this->goodsSpec,
|
||||
'amount' => new Money($this->amount['price'], $this->amount['currency'])
|
||||
'amount' => new Money($this->amount['price'], new Currency($this->amount['currency']))
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,6 @@ final class GoodsRpc
|
||||
|
||||
$response = $this->requestService->requestGet("/rpc/v1/goods/$goodsId/search", $specifies);
|
||||
$content = $response->getBody()->getContents();
|
||||
return Goods::make(Json::decode($content, false));
|
||||
return Goods::make(Json::decode($content));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user