diff --git a/app/Services/PatientPathographyService.php b/app/Services/PatientPathographyService.php index 80c6358..8b5c46f 100644 --- a/app/Services/PatientPathographyService.php +++ b/app/Services/PatientPathographyService.php @@ -7,6 +7,7 @@ use App\Model\OrderPrescription; use App\Model\OrderPrescriptionIcd; use App\Model\OrderPrescriptionProduct; use App\Model\OrderProduct; +use App\Model\PatientFamily; use App\Model\PatientPathography; use App\Model\PatientPathographyProduct; use App\Model\Product; @@ -50,11 +51,18 @@ class PatientPathographyService extends BaseService */ public function getFamilyPathographyPage(): array { - $user_info = $this->request->getAttribute("userInfo") ?? []; $family_id = $this->request->input('family_id'); $page = $this->request->input('page', 1); $per_page = $this->request->input('per_page', 10); + // 获取家庭成员数据 + $params = array(); + $params['family_id'] = $family_id; + $patient_family = PatientFamily::getOne($params); + if (empty($patient_family)){ + return fail(); + } + // 获取病情记录列表 $fields = [ "pathography_id", @@ -67,8 +75,7 @@ class PatientPathographyService extends BaseService ]; $params = array(); - $params['user_id'] = $user_info['user_id']; - $params['patient_id'] = $user_info['client_user_id']; + $params['patient_id'] = $patient_family['patient_id']; $params['family_id'] = $family_id; $params['status'] = 1; $patient_pathographys = PatientPathography::getPatientPathographyPage($params, $fields, $page, $per_page);