Browse Source

11月8日库存管理

XMLWAN 3 years ago
parent
commit
3c20c30c2f
1 changed files with 6 additions and 5 deletions
  1. 6 5
      service/doctor_schedule_service.go

+ 6 - 5
service/doctor_schedule_service.go View File

@@ -686,12 +686,13 @@ func GetDialyisSolution(patientid int64, recorddate int64) (*models.DialysisPres
686 686
 
687 687
 	prescription := models.DialysisPrescription{}
688 688
 
689
-	err := XTReadDB().Model(&prescription).Where("patient_id = ? and record_date = ? and status = 1", patientid, recorddate).Find(&prescription).Error
690
-	if err == gorm.ErrRecordNotFound {
691
-		return nil, err
692
-	}
689
+	err := XTReadDB().Where("patient_id = ? and record_date = ? and status = 1", patientid, recorddate).Find(&prescription).Error
693 690
 	if err != nil {
694
-		return nil, err
691
+		if err == gorm.ErrRecordNotFound {
692
+			return nil, err
693
+		} else {
694
+			return nil, err
695
+		}
695 696
 	}
696 697
 	return &prescription, nil
697 698
 }