Browse Source

历史排班

28169 1 year ago
parent
commit
b4c5757d88
2 changed files with 6 additions and 1 deletions
  1. 2 1
      controllers/pharmacy_controller.go
  2. 4 0
      service/pharmacy_service.go

+ 2 - 1
controllers/pharmacy_controller.go View File

169
 
169
 
170
 		//获取排班班次
170
 		//获取排班班次
171
 		schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition)
171
 		schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition)
172
+
172
 		var ids []int64
173
 		var ids []int64
173
 		for _, item := range schedule {
174
 		for _, item := range schedule {
174
 			ids = append(ids, item.PatientId)
175
 			ids = append(ids, item.PatientId)
175
 		}
176
 		}
176
 
177
 
177
 		list, _ := service.GetTodayAdviceCountOne(stime, etime, orgid, 1, ids)
178
 		list, _ := service.GetTodayAdviceCountOne(stime, etime, orgid, 1, ids)
178
-		fmt.Println("list23323232323232", list)
179
+
179
 		var flist []models.TmpPatientOne
180
 		var flist []models.TmpPatientOne
180
 		if len(list) > 0 {
181
 		if len(list) > 0 {
181
 			for _, item := range list {
182
 			for _, item := range list {

+ 4 - 0
service/pharmacy_service.go View File

134
 	if orgid > 0 {
134
 	if orgid > 0 {
135
 		db = db.Where("user_org_id = ?", orgid)
135
 		db = db.Where("user_org_id = ?", orgid)
136
 	}
136
 	}
137
+
138
+	if len(ids) == 0 {
139
+		db = db.Where("patient_id not in(?)", ids)
140
+	}
137
 	if len(ids) > 0 {
141
 	if len(ids) > 0 {
138
 		db = db.Where("patient_id in(?)", ids)
142
 		db = db.Where("patient_id in(?)", ids)
139
 	}
143
 	}