|
@@ -438,8 +438,9 @@ func GetNewDialysisCountMode(starttime int64, endtime int64, orgid int64, origin
|
438
|
438
|
if orgid > 0 {
|
439
|
439
|
db = db.Where("o.user_org_id = ?", orgid)
|
440
|
440
|
}
|
|
441
|
+ db = db.Where("o.stage = 2")
|
441
|
442
|
if mode_id == 0 {
|
442
|
|
- err = db.Select("s.mode_id,count(s.mode_id) as count").Joins("join xt_dialysis_prescription as s on s.patient_id = o.patient_id and s.record_date = o.dialysis_date and s.status= 1 AND s.record_date >= ? AND s.record_date <= ? AND s.mode_id > 0 ", starttime, endtime).Group("s.mode_id").Scan(&counts).Error
|
|
443
|
+ err = db.Select("s.mode_id,count(s.mode_id) as count").Joins("join xt_dialysis_prescription as s on s.patient_id = o.patient_id and s.record_date = o.dialysis_date and s.status= 1 AND s.record_date >= ? AND s.record_date <= ? AND s.mode_id > 0", starttime, endtime).Group("s.mode_id").Scan(&counts).Error
|
443
|
444
|
|
444
|
445
|
} else {
|
445
|
446
|
|