|
|
|
|
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 {
|
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
|
return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
|
609
|
return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
|
610
|
}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
|
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
|
}).Find(&list).Error
|
612
|
}).Find(&list).Error
|
613
|
|
613
|
|
614
|
return list, err
|
614
|
return list, err
|
|
|
|
|
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 {
|
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
|
return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
|
634
|
return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
|
635
|
}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
|
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
|
}).Find(&list).Error
|
637
|
}).Find(&list).Error
|
638
|
|
638
|
|
639
|
return list, err
|
639
|
return list, err
|