Преглед на файлове

Merge branch '20220812' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

28169 преди 2 години
родител
ревизия
87696e03d8
променени са 1 файла, в които са добавени 11 реда и са изтрити 5 реда
  1. 11 5
      service/his_service.go

+ 11 - 5
service/his_service.go Целия файл

981
 		db = db.Joins("join xt_patients as patient on patient.id = his_order.patient_id  AND patient.name like ? AND patient.user_org_id = ?", keywords, user_org_id)
981
 		db = db.Joins("join xt_patients as patient on patient.id = his_order.patient_id  AND patient.name like ? AND patient.user_org_id = ?", keywords, user_org_id)
982
 
982
 
983
 	}
983
 	}
984
-
985
-	if sch_type > 0 {
986
-		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_type = ? AND sch.schedule_date >= ? AND sch.schedule_date <= ?", sch_type, start_time_timestamp, end_time_timestamp)
984
+	if sch_type > 0 && zone_type > 0 {
985
+		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_type = ? AND sch.schedule_date >= ? AND sch.schedule_date <= ? AND sch.partition_id = ? AND sch.status  = 1", sch_type, start_time_timestamp, end_time_timestamp, zone_type)
987
 	}
986
 	}
988
-	if zone_type > 0 {
989
-		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.partition_id = ?", zone_type)
987
+	if sch_type > 0 && zone_type == 0 {
988
+		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_type = ? AND sch.schedule_date >= ? AND sch.schedule_date <= ? AND sch.status = 1", sch_type, start_time_timestamp, end_time_timestamp)
990
 	}
989
 	}
990
+	if sch_type == 0 && zone_type > 0 {
991
+		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)
992
+	}
993
+
994
+	//if zone_type > 0 {
995
+	//	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)
996
+	//}
991
 
997
 
992
 	if sort_type == 1 {
998
 	if sort_type == 1 {
993
 		if start_time_timestamp != 0 {
999
 		if start_time_timestamp != 0 {