Browse Source

体积小

XMLWAN 3 years ago
parent
commit
2ecfc3d3e3

+ 2 - 5
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go View File

476
 		return
476
 		return
477
 	}
477
 	}
478
 
478
 
479
-	dialysisPrescribe, _ := service.MobileGetDialysisPrescribeByModeIdSix(info.UserOrgId, patientID, schedual.ModeId, timeNowUnix.Unix())
480
-
481
 	dialysisSolution, _ := service.MobileGetDialysisSolutionByModeId(info.UserOrgId, patientID, schedual.ModeId)
479
 	dialysisSolution, _ := service.MobileGetDialysisSolutionByModeId(info.UserOrgId, patientID, schedual.ModeId)
482
 
480
 
483
 	lastDialysisPrescribe, _ := service.MobileGetLastDialysisPrescribeByModeId(info.UserOrgId, patientID, schedual.ModeId)
481
 	lastDialysisPrescribe, _ := service.MobileGetLastDialysisPrescribeByModeId(info.UserOrgId, patientID, schedual.ModeId)
498
 	//获取最后一次血管通路
496
 	//获取最后一次血管通路
499
 	lastAssessment, _ := service.GetLastPassWayAssessment(info.UserOrgId, patientID)
497
 	lastAssessment, _ := service.GetLastPassWayAssessment(info.UserOrgId, patientID)
500
 
498
 
501
-	prescribeOne, _ := service.MobileGetDialysisPrescribeByModeIdFive(info.UserOrgId, patientID)
499
+	prescribeOne, _ := service.MobileGetDialysisPrescribeByModeIdFive(info.UserOrgId, patientID, timeNowUnix.Unix())
502
 	var his_advices []*models.HisDoctorAdviceInfo
500
 	var his_advices []*models.HisDoctorAdviceInfo
503
 	if is_open_config.IsOpen == 1 {
501
 	if is_open_config.IsOpen == 1 {
504
 		his_advices, _ = service.GetAllHisDoctorAdviceOne(info.UserOrgId, patientID, timeNowUnix.Unix())
502
 		his_advices, _ = service.GetAllHisDoctorAdviceOne(info.UserOrgId, patientID, timeNowUnix.Unix())
524
 	returnData := map[string]interface{}{
522
 	returnData := map[string]interface{}{
525
 		"patient":                        patient,
523
 		"patient":                        patient,
526
 		"schedual":                       schedual,
524
 		"schedual":                       schedual,
527
-		"prescription":                   dialysisPrescribe,
525
+		"prescription":                   prescribeOne,
528
 		"solution":                       dialysisSolution,
526
 		"solution":                       dialysisSolution,
529
 		"last_prescription":              lastDialysisPrescribe,
527
 		"last_prescription":              lastDialysisPrescribe,
530
 		"receiver_treatment_access":      receiverTreatmentAccess,
528
 		"receiver_treatment_access":      receiverTreatmentAccess,
547
 		"stockType":                      stockType,
545
 		"stockType":                      stockType,
548
 		"prepare":                        prepare,
546
 		"prepare":                        prepare,
549
 		"lastAssessment":                 lastAssessment,
547
 		"lastAssessment":                 lastAssessment,
550
-		"prescribeOne":                   prescribeOne,
551
 		"is_project_open_config":         is_project_open_config,
548
 		"is_project_open_config":         is_project_open_config,
552
 		"project":                        projects,
549
 		"project":                        projects,
553
 	}
550
 	}

+ 2 - 2
service/xcx_mobile_api_service.go View File

496
 	return prepare, err
496
 	return prepare, err
497
 }
497
 }
498
 
498
 
499
-func MobileGetDialysisPrescribeByModeIdFive(orgID int64, patientID int64) (*models.DialysisPrescription, error) {
499
+func MobileGetDialysisPrescribeByModeIdFive(orgID int64, patientID int64, record_date int64) (*models.DialysisPrescription, error) {
500
 	var record models.DialysisPrescription
500
 	var record models.DialysisPrescription
501
-	err := readDb.Model(&models.DialysisPrescription{}).Where("patient_id = ? and user_org_id = ? and status = 1", patientID, orgID).Last(&record).Error
501
+	err := readDb.Model(&models.DialysisPrescription{}).Where("patient_id = ? and user_org_id = ? and status = 1 and record_date = ?", patientID, orgID, record_date).Find(&record).Error
502
 	if err != nil {
502
 	if err != nil {
503
 		if err == gorm.ErrRecordNotFound {
503
 		if err == gorm.ErrRecordNotFound {
504
 			return nil, nil
504
 			return nil, nil