Ver código fonte

提交代码

陈少旭 6 meses atrás
pai
commit
c903f81746

+ 2 - 2
controllers/zuobiao_api_controller.go Ver arquivo

@@ -92,14 +92,14 @@ func (c *ZuobiaoApiController) GetHisZuoBiaoDetailInfo() {
92 92
 	} else if is_upload == 2 { //已上传
93 93
 		prescriptions, _ = service.GetUploadHisZuoBiaoPrescription(adminInfo.CurrentOrgId, patient_id, recordDateTime)
94 94
 	}
95
-	patient, _ := service.GetPatientByID(c.GetAdminUserInfo().CurrentOrgId, patient_id)
95
+	patient, _ := service.GetPatientByIDThree(c.GetAdminUserInfo().CurrentOrgId, patient_id)
96 96
 	var monthPrescriptions []*models.HisPrescription
97 97
 	if is_upload == 1 {
98 98
 		monthPrescriptions, _ = service.GetMonthUnUploadHisZuoBiaoPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
99 99
 	} else if is_upload == 2 {
100 100
 		monthPrescriptions, _ = service.GetMonthUploadHisZuoBiaoPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
101 101
 	}
102
-	prescription_info, _ := service.GetZuoBiaoPrescriptionInfo(c.GetAdminUserInfo().CurrentOrgId, patient.ID)
102
+	prescription_info, _ := service.GetZuoBiaoPrescriptionInfo(adminInfo.CurrentOrgId, patient.ID)
103 103
 
104 104
 	c.ServeSuccessJSON(map[string]interface{}{
105 105
 		"prescription":        prescriptions,

+ 13 - 0
service/patient_dataconfig_service.go Ver arquivo

@@ -153,3 +153,16 @@ func GetFaPiaoPatientByID(orgID int64, patientID int64) (*models.Patients, error
153 153
 	}
154 154
 	return &patient, nil
155 155
 }
156
+
157
+func GetPatientByIDThree(orgID int64, patientID int64) (*models.Patients, error) {
158
+	var patient models.Patients
159
+	err := readDb.Model(&models.Patients{}).Where("id = ? and user_org_id=? and status=1", patientID, orgID).First(&patient).Error
160
+	if err != nil {
161
+		if err == gorm.ErrRecordNotFound {
162
+			return nil, nil
163
+		} else {
164
+			return nil, err
165
+		}
166
+	}
167
+	return &patient, nil
168
+}