|
@@ -609,6 +609,8 @@ func GetWeekDayScheduleByIdThee(orgid int64, scheduleDate int64, scheduleType in
|
609
|
609
|
return db.Where("status =1 and parent_id = 0 and advice_date = ?", scheduleDate).Preload("ChildDoctorAdvice", "status = 1")
|
610
|
610
|
}).Preload("HisDoctorAdviceInfo", "status = 1 and advice_date = ?", scheduleDate).Preload("DialysisPrescription", "status = 1 and record_date =?", scheduleDate).Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
|
611
|
611
|
return db.Where("status =1").Order("id asc")
|
|
612
|
+ }).Preload("LastAfterWeight", func(db *gorm.DB) *gorm.DB {
|
|
613
|
+ return db.Where("user_org_id = ? and status = 1 and assessment_date < ?", orgid, scheduleDate)
|
612
|
614
|
}).Find(&list).Error
|
613
|
615
|
|
614
|
616
|
return list, err
|
|
@@ -634,6 +636,8 @@ func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int
|
634
|
636
|
return db.Where("status =1 and parent_id = 0 and advice_date = ?", scheduleDate).Preload("ChildDoctorAdvice", "status = 1")
|
635
|
637
|
}).Preload("HisDoctorAdviceInfo", "status = 1 and advice_date = ?", scheduleDate).Preload("DialysisPrescription", "status = 1 and record_date = ?", scheduleDate).Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
|
636
|
638
|
return db.Where("status =1").Order("id asc")
|
|
639
|
+ }).Preload("LastAfterWeight", func(db *gorm.DB) *gorm.DB {
|
|
640
|
+ return db.Where("user_org_id = ? and status = 1 and assessment_date < ?", orgid, scheduleDate)
|
637
|
641
|
}).Find(&list).Error
|
638
|
642
|
|
639
|
643
|
return list, err
|
|
@@ -987,6 +991,8 @@ func GetDataPrint(orgid int64) (models.XtDataPrint, error) {
|
987
|
991
|
|
988
|
992
|
func GetNextWeekPanels(startime int64, endtime int64, orgid int64) (schedule []*models.XtSchedule, err error) {
|
989
|
993
|
|
990
|
|
- err = XTReadDB().Model(&schedule).Where("schedule_date >=? and schedule_date<=? and status = 1 and user_org_id = ?", startime, endtime, orgid).Find(&schedule).Error
|
|
994
|
+ err = XTReadDB().Model(&schedule).Where("schedule_date >=? and schedule_date<=? and status = 1 and user_org_id = ?", startime, endtime, orgid).Preload("LastAfterWeight", func(db *gorm.DB) *gorm.DB {
|
|
995
|
+ return db.Where("user_org_id = ? and status = 1 and assessment_date < ?", orgid, endtime)
|
|
996
|
+ }).Find(&schedule).Error
|
991
|
997
|
return schedule, err
|
992
|
998
|
}
|