|
@@ -57,7 +57,7 @@ func GetSchedules(orgID int64, schIDs []string) ([]*ScheduleVM, error) {
|
57
|
57
|
return nil, err
|
58
|
58
|
}
|
59
|
59
|
for _, item := range schedules {
|
60
|
|
- if orgID != 10101 {
|
|
60
|
+ if orgID != 10101 && orgID != 10445 {
|
61
|
61
|
dialysis_count, _ := GetDialysisOrderCount(orgID, item.PatientID, item.ScheduleDate)
|
62
|
62
|
|
63
|
63
|
item.Patient.TotalDialysis = dialysis_count
|
|
@@ -227,6 +227,12 @@ func GetDialysisOrderCountEight(orgID int64, patient_id int64, recordDate int64)
|
227
|
227
|
return order, err
|
228
|
228
|
}
|
229
|
229
|
|
|
230
|
+func GetDialysisOrderCountNight(orgID int64, patient_id int64, recordDate int64) (models.VmDialysisOrder, error) {
|
|
231
|
+ order := models.VmDialysisOrder{}
|
|
232
|
+ err := p_service.XTReadDB().Raw("SELECT Count(id) as count,Max(dialysis_date) as dialysis_date from xt_dialysis_order where dialysis_date>=1672502400 and dialysis_date <= ? AND status = 1 AND stage = 2 AND patient_id = ? and user_org_id = ?", recordDate, patient_id, orgID).Scan(&order).Error
|
|
233
|
+ return order, err
|
|
234
|
+}
|
|
235
|
+
|
230
|
236
|
func GetOutStockTotalCountTwo(startime int64, endtime int64, orgid int64) (autoMatic []*models.NewXtAutomaticReduceDetail, err error) {
|
231
|
237
|
|
232
|
238
|
err = p_service.XTReadDB().Raw("SELECT good_id,SUM(b.count) as count FROM (SELECT DISTINCT x.patient_id,x.good_id,x.record_time,x.count FROM xt_automatic_reduce_detail as x WHERE x.org_id = ? and x.record_time >= ? and x.record_time<=? and `status` = 1) as b GROUP BY good_id", orgid, startime, endtime).Scan(&autoMatic).Error
|