|
@@ -608,7 +608,7 @@ func GetWeekDayScheduleByIdThee(orgid int64, scheduleDate int64, scheduleType in
|
608
|
608
|
err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("XtAssessmentBeforeDislysis", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
|
609
|
609
|
return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
|
610
|
610
|
}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
|
611
|
|
- return db.Where("status =1").Order("id asc")
|
|
611
|
+ return db.Where("status =1").Group("mode_id").Order("id asc")
|
612
|
612
|
}).Find(&list).Error
|
613
|
613
|
|
614
|
614
|
return list, err
|
|
@@ -633,7 +633,7 @@ func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int
|
633
|
633
|
err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("XtAssessmentBeforeDislysis", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
|
634
|
634
|
return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
|
635
|
635
|
}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
|
636
|
|
- return db.Where("status =1").Order("id asc")
|
|
636
|
+ return db.Where("status =1").Group("mode_id").Order("id asc")
|
637
|
637
|
}).Find(&list).Error
|
638
|
638
|
|
639
|
639
|
return list, err
|