From 3b1221634419f0ca39359e36c0363602b075b9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=9C=E4=BA=91?= Date: Sat, 6 Sep 2025 03:06:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(PointLog):=20=E6=B7=BB=E5=8A=A0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=97=85=E4=BA=BA=E5=A7=93=E5=90=8D=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=B9=B6=E6=9B=B4=E6=96=B0=E7=9B=B8=E5=85=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 PointLog 类中添加 patientName属性和 getPatientName() 方法 - 更新 PointLogRepo 类,从数据库中获取并设置 patient_name 字段 --- src/Domain/Account/Aggregate/PointLog/PointLog.php | 6 ++++++ src/Infrastructure/Repository/PointLogRepo.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/Domain/Account/Aggregate/PointLog/PointLog.php b/src/Domain/Account/Aggregate/PointLog/PointLog.php index 5740b92..62cd01a 100644 --- a/src/Domain/Account/Aggregate/PointLog/PointLog.php +++ b/src/Domain/Account/Aggregate/PointLog/PointLog.php @@ -25,11 +25,17 @@ final class PointLog extends AggregateRoot private readonly string $source, private readonly string $operator, private readonly string $description, + private readonly string $patientName, private readonly Carbon $date, private readonly bool $invoiceable, private readonly ?InvoiceRecord $invoiceRecord, ) {} + public function getPatientName(): string + { + return $this->patientName; + } + public function getDescription(): string { return $this->description; diff --git a/src/Infrastructure/Repository/PointLogRepo.php b/src/Infrastructure/Repository/PointLogRepo.php index ac54b7a..1f70acc 100644 --- a/src/Infrastructure/Repository/PointLogRepo.php +++ b/src/Infrastructure/Repository/PointLogRepo.php @@ -44,6 +44,7 @@ final class PointLogRepo extends AbstractRepo implements PointLogRepoInterface source: $item['source'], operator: $item['operator'], description: $item['description'], + patientName: $item['patient_name'], date: new Carbon($item['date']), invoiceable: $item['invoiceable'], invoiceRecord: isset($item['invoice_record']) @@ -74,6 +75,7 @@ final class PointLogRepo extends AbstractRepo implements PointLogRepoInterface source: $result['source'], operator: $result['operator'], description: $result['description'], + patientName: $result['patient_name'], date: new Carbon($result['date']), invoiceable: $result['invoiceable'], invoiceRecord: isset($result['invoice_record'])