Browse Source

提交代码

陈少旭 1 year ago
parent
commit
846eac50d9
2 changed files with 7 additions and 2 deletions
  1. 2 1
      controllers/his_api_controller.go
  2. 5 1
      service/his_service.go

+ 2 - 1
controllers/his_api_controller.go View File

@@ -6212,6 +6212,7 @@ func (c *HisApiController) GetHisOrderList() {
6212 6212
 	charge_type, _ := c.GetInt64("charge_type", 0)
6213 6213
 	sch_type, _ := c.GetInt64("sch_type", 0)
6214 6214
 	zone_type, _ := c.GetInt64("zone_type", 0)
6215
+	med_type, _ := c.GetInt64("med_type", 0)
6215 6216
 
6216 6217
 	timeLayout := "2006-01-02"
6217 6218
 	loc, _ := time.LoadLocation("Local")
@@ -6238,7 +6239,7 @@ func (c *HisApiController) GetHisOrderList() {
6238 6239
 
6239 6240
 	adminUser := c.GetAdminUserInfo()
6240 6241
 	org_id := adminUser.CurrentOrgId
6241
-	order, err, total := service.GetHisOrderList(org_id, page, limit, startTime, endTime, types, keywords, p_type, sort_type, start_time, end_time, charge_type, sch_type, zone_type)
6242
+	order, err, total := service.GetHisOrderList(org_id, page, limit, startTime, endTime, types, keywords, p_type, sort_type, start_time, end_time, charge_type, sch_type, zone_type, med_type)
6242 6243
 
6243 6244
 	for _, item := range order {
6244 6245
 		info, _ := service.GetHisPrescriptionByPatientID(item.PatientId, item.UserOrgId)

+ 5 - 1
service/his_service.go View File

@@ -975,7 +975,7 @@ func SavePatientPrescriptionInfo(info models.HisPrescriptionInfo) (err error) {
975 975
 	return
976 976
 }
977 977
 
978
-func GetHisOrderList(user_org_id int64, page int64, limit int64, start_time_timestamp int64, end_time_timestamp int64, doctor_id int64, keywords string, p_type int64, sort_type int64, start_time string, end_time string, charge_type int64, sch_type int64, zone_type int64) (order []*models.HisOrder, err error, total int64) {
978
+func GetHisOrderList(user_org_id int64, page int64, limit int64, start_time_timestamp int64, end_time_timestamp int64, doctor_id int64, keywords string, p_type int64, sort_type int64, start_time string, end_time string, charge_type int64, sch_type int64, zone_type int64, med_type int64) (order []*models.HisOrder, err error, total int64) {
979 979
 	offset := (page - 1) * limit
980 980
 	db := readDb.Model(&models.HisOrder{})
981 981
 
@@ -998,6 +998,10 @@ func GetHisOrderList(user_org_id int64, page int64, limit int64, start_time_time
998 998
 		db = db.Joins("join xt_schedule sch on sch.schedule_date = his_order.settle_accounts_date AND sch.patient_id = his_order.patient_id  AND sch.schedule_date >= ? AND sch.schedule_date <= ? AND sch.partition_id = ? AND sch.status = 1", start_time_timestamp, end_time_timestamp, zone_type)
999 999
 	}
1000 1000
 
1001
+	if med_type > 0 {
1002
+		db = db.Where("his_order.med_type = ?", med_type)
1003
+	}
1004
+
1001 1005
 	//if zone_type > 0 {
1002 1006
 	//	db = db.Joins("join xt_schedule sch_two on sch_two.schedule_date = his_order.settle_accounts_date AND sch_two.patient_id = his_order.patient_id AND sch_two.partition_id = ?", zone_type)
1003 1007
 	//}