Browse Source

体积小

XMLWAN 3 years ago
parent
commit
2ecfc3d3e3

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

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

+ 2 - 2
service/xcx_mobile_api_service.go View File

@@ -496,9 +496,9 @@ func GetDialyStockOutOne(orgid int64, patientId int64) (prepare []*models.XtDial
496 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 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 502
 	if err != nil {
503 503
 		if err == gorm.ErrRecordNotFound {
504 504
 			return nil, nil