From beaba99449a3a3ca67e0f2310c0e564ba158ec41 Mon Sep 17 00:00:00 2001 From: liqi Date: Mon, 6 Jan 2025 17:40:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=82=A3=E8=80=85=E7=AB=AF=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- member/modules/v1/controllers/PatientController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/member/modules/v1/controllers/PatientController.php b/member/modules/v1/controllers/PatientController.php index 706442e..de291a4 100644 --- a/member/modules/v1/controllers/PatientController.php +++ b/member/modules/v1/controllers/PatientController.php @@ -67,6 +67,16 @@ class PatientController extends BaseAppController $this->requestValidate($post, [ ['up_id', 'required'] ]); + if (!empty($post['id']?? '')) { + $info = UserPatient::find()->where([ + 'id' => $post['up_id'], + 'user_id' => \Yii::$app->user->identity->getId(), + ])->one(); + if (!$info) { + throw new Exception('就诊人不存在'); + } + $post['id_card'] = $info->id_card; + } $form = new PatientForm(); $form->attributes = $post;