XMLWAN 4 vuotta sitten
vanhempi
commit
7c88e2dd53

+ 6 - 1
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go Näytä tiedosto

@@ -1000,6 +1000,7 @@ func (this *NewDialysisApiController) ToSearchePatient() {
1000 1000
 	fmt.Print("关键字", keyword)
1001 1001
 	adminUserinfo := this.GetMobileAdminUserInfo()
1002 1002
 	orgid := adminUserinfo.Org.Id
1003
+	fmt.Println("j击鼓ID=--------------------------", orgid)
1003 1004
 	patient, err := service.ToSearchePatient(keyword, orgid)
1004 1005
 	if err != nil {
1005 1006
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
@@ -1137,7 +1138,11 @@ func (this *NewDialysisApiController) GetDoctorAdviceDetail() {
1137 1138
 	orgid := adminUser.Org.Id
1138 1139
 	appid := adminUser.App.Id
1139 1140
 	id, _ := this.GetInt64("id")
1140
-	doctorAdvicedetail, err := service.GetDoctorAdviceDetail(id, orgid)
1141
+	bloodTwo, _ := service.GetPatientDetailTwo(id)
1142
+	fmt.Println("id", bloodTwo.BloodId)
1143
+	date, _ := this.GetInt64("date")
1144
+	doctorAdvicedetail, err := service.GetDoctorAdviceDetail(date, bloodTwo.BloodId, orgid)
1145
+	fmt.Println("err-------------------------------", err)
1141 1146
 	doctorDetail, err := service.GetAllDoctorTwo(orgid, appid)
1142 1147
 	if err != nil {
1143 1148
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)

+ 3 - 3
service/patientmanage_service.go Näytä tiedosto

@@ -733,7 +733,7 @@ func DeleteRescueRecord(id int64) error {
733 733
 
734 734
 func ToSearchePatient(keyword string, orgId int64) (paitents []*models.XtPatientsNew, err error) {
735 735
 	likeKey := "%" + keyword + "%"
736
-	err = XTReadDB().Where("name like ? or dialysis_no like ? and user_org_id = ?", likeKey, likeKey, orgId).Find(&paitents).Error
736
+	err = XTReadDB().Where("user_org_id = ? and name like ? or dialysis_no like ?", orgId, likeKey, likeKey).Find(&paitents).Error
737 737
 	return paitents, err
738 738
 }
739 739
 
@@ -879,10 +879,10 @@ func GetAllDoctorTwo(orgid int64, appid int64) (appRole []*models.SgjUserAdminRo
879 879
 	return appRole, err
880 880
 }
881 881
 
882
-func GetDoctorAdviceDetail(id int64, orgid int64) (advices []*models.DoctorAdvices, err error) {
882
+func GetDoctorAdviceDetail(state int64, id int64, orgid int64) (advices []*models.DoctorAdvices, err error) {
883 883
 
884 884
 	db := XTReadDB().Table("xt_doctor_advice as x")
885
-	err = db.Order("x.id desc").Select("x.id,x.user_org_id,x.patient_id,x.advice_type,x.advice_date,x.start_time,x.advice_name,x.advice_desc,x.reminder_date,x.single_dose,x.single_dose_unit,x.prescribing_number,x.prescribing_number_unit,x.delivery_way,x.execution_frequency,x.advice_doctor,x.status,x.created_time,x.updated_time,x.advice_affirm,x.remark,x.stop_time,x.stop_reason,x.stop_doctor,x.stop_state,x.parent_id,x.execution_time,x.execution_staff,x.execution_state,x.checker,x.record_date,x.dialysis_order_id,x.check_time,x.check_state,x.drug_spec,x.drug_spec_unit,x.groupno,x.remind_type,x.frequency_type,x.day_count,x.week_day,x.template_id,x.modifier,s.name").Joins("left join xt_patients as s on s.id=x.patient_id").Where("x.start_time = ? and x.status = 1 and x.user_org_id = ?", id, orgid).Scan(&advices).Error
885
+	err = db.Order("x.id desc").Select("x.id,x.user_org_id,x.patient_id,x.advice_type,x.advice_date,x.start_time,x.advice_name,x.advice_desc,x.reminder_date,x.single_dose,x.single_dose_unit,x.prescribing_number,x.prescribing_number_unit,x.delivery_way,x.execution_frequency,x.advice_doctor,x.status,x.created_time,x.updated_time,x.advice_affirm,x.remark,x.stop_time,x.stop_reason,x.stop_doctor,x.stop_state,x.parent_id,x.execution_time,x.execution_staff,x.execution_state,x.checker,x.record_date,x.dialysis_order_id,x.check_time,x.check_state,x.drug_spec,x.drug_spec_unit,x.groupno,x.remind_type,x.frequency_type,x.day_count,x.week_day,x.template_id,x.modifier,s.name").Joins("left join xt_patients as s on s.id=x.patient_id").Where("x.start_time = ? and x.patient_id = ? and x.user_org_id = ? and x.status = 1", state, id, orgid).Scan(&advices).Error
886 886
 
887 887
 	return advices, err
888 888
 }