|
@@ -981,13 +981,19 @@ func GetHisOrderList(user_org_id int64, page int64, limit int64, start_time_time
|
981
|
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
|
+
|
|
995
|
+
|
|
996
|
+
|
991
|
997
|
|
992
|
998
|
if sort_type == 1 {
|
993
|
999
|
if start_time_timestamp != 0 {
|