From 012d611a26c190302da3820bbbfd09e5adef1d3a Mon Sep 17 00:00:00 2001 From: Jiannei Date: Thu, 10 Mar 2022 10:53:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E6=98=A0=E5=B0=84?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=84=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Response.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Response.php b/src/Response.php index 3c7b96f..fda8429 100644 --- a/src/Response.php +++ b/src/Response.php @@ -256,10 +256,11 @@ protected function formatDataFields(array $responseData, array $dataFieldsConfig $alias = $fieldConfig['alias'] ?? $field; $show = $fieldConfig['show'] ?? true; + $map = $fieldConfig['map'] ?? null; unset($responseData[$field]); if ($show) { - $responseData[$alias] = $value; + $responseData[$alias] = $map[$value] ?? $value; } }