From 1f0caae9b53229965374198db596122a16532977 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Thu, 20 Apr 2023 18:40:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=97=85=E4=BE=8Bb=E6=81=A9?= =?UTF-8?q?=E4=BA=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/PatientFamilyService.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/Services/PatientFamilyService.php b/app/Services/PatientFamilyService.php index 22ae70a..9158d4a 100644 --- a/app/Services/PatientFamilyService.php +++ b/app/Services/PatientFamilyService.php @@ -333,16 +333,15 @@ class PatientFamilyService extends BaseService $params[] = ["family_id", '!=', $family_id]; $patient_familys = PatientFamilyModel::getList($params); if (!empty($patient_familys)) { - foreach ($patient_familys as $key => $value) { + foreach ($patient_familys as $value) { if ($value['family_id'] == $family_id){ continue; } + // 检测姓名是否重复 - if ($patient_family['card_name'] != $request_params['card_name']) { - if ($request_params['card_name'] == $value['card_name']) { - // 姓名改变 检测是否与其他家庭成员姓名重复 - return fail(HttpEnumCode::HTTP_ERROR, "姓名重复"); - } + if ($value['card_name'] != $request_params['card_name']) { + // 姓名改变 检测是否与其他家庭成员姓名重复 + return fail(HttpEnumCode::HTTP_ERROR, "姓名重复"); } // 检测证件号是否重复 @@ -352,7 +351,7 @@ class PatientFamilyService extends BaseService // 检测是否已经存在本人 if (isset($request_params['relation'])) { - if ($request_params['relation'] == 1 && $patient_family['relation'] == 1) { + if ($request_params['relation'] == 1 && $value['relation'] == 1) { return fail(HttpEnumCode::HTTP_ERROR, "关系为本人的患者只能添加一位"); } }