From 641a304cafb7a87f72d21027b764a423441bc5f6 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Thu, 29 Feb 2024 16:38:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96=E5=AE=B6?= =?UTF-8?q?=E5=BA=AD=E6=88=90=E5=91=98=E6=97=B6=E5=A6=82=E5=B9=B4=E9=BE=84?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9=EF=BC=8C=E8=BF=9B=E8=A1=8C=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/PatientFamilyService.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/Services/PatientFamilyService.php b/app/Services/PatientFamilyService.php index f565405..9c4dba6 100644 --- a/app/Services/PatientFamilyService.php +++ b/app/Services/PatientFamilyService.php @@ -7,6 +7,7 @@ use App\Model\BasicJob; use App\Model\BasicNation; use App\Model\DiseaseClass; use App\Model\OrderProduct; +use App\Model\PatientFamily; use App\Model\PatientFamily as PatientFamilyModel; use App\Model\PatientFamilyHealth; use App\Model\PatientFamilyPersonal as PatientFamilyPersonalModel; @@ -55,8 +56,20 @@ class PatientFamilyService extends BaseService $patient_familys = $patient_familys->toArray(); foreach ($patient_familys as &$value){ // 计算年龄 - $value['age'] = getIdCardAge($value['id_number']); + $age = getIdCardAge($value['id_number']); unset($value['id_number']); + + // 修正年龄 + if ($value['age'] != $age){ + $params = array(); + $params['family_id'] = $value['family_id']; + + $data = array(); + $data['age'] = $age; + PatientFamily::edit($params,$data); + + $value['age'] = $age; + } } return success($patient_familys);