Kaynağa Gözat

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

28169 7 ay önce
ebeveyn
işleme
9e62695f10

+ 2 - 2
service/his_charge_service.go Dosyayı Görüntüle

@@ -1086,7 +1086,7 @@ func GetHisPrescriptionDrugDetails(org_id int64, start_time_str string, end_time
1086 1086
 			db = db.Joins("JOIN `his_prescription` o ON oi.`prescription_id` = o.id and   FROM_UNIXTIME(o.record_date, '%Y-%m-%d %H:%i:%S') BETWEEN ? AND ?  and o.status = 1 and o.order_status <> 2", start_time_str, end_time_str)
1087 1087
 		}
1088 1088
 	}
1089
-	db = db.Joins("JOIN `his_order` oo on oo.`number` = o.`batch_number` and oo.user_org_id = ?", org_id)
1089
+	db = db.Joins("left JOIN `his_order` oo on oo.`number` = o.`batch_number` and oo.user_org_id = ?", org_id)
1090 1090
 
1091 1091
 	err = db.Where(" oi.user_org_id = ?  AND o.record_date >= ? AND o.record_date <= ? AND oi.status = 1", org_id, start_time, end_time).Scan(&patients).Error
1092 1092
 
@@ -1113,7 +1113,7 @@ func GetHisPrescriptionProjectDetails(org_id int64, start_time_str string, end_t
1113 1113
 	} else {
1114 1114
 		db = db.Joins("JOIN `his_prescription` o ON oi.`prescription_id` = o.id and   FROM_UNIXTIME(o.record_date, '%Y-%m-%d %H:%i:%S') BETWEEN ? AND ?  and o.status = 1", start_time_str, end_time_str)
1115 1115
 	}
1116
-	db = db.Joins("JOIN `his_order` oo on oo.`number` = o.`batch_number` and oo.user_org_id = ?", org_id)
1116
+	db = db.Joins("left JOIN `his_order` oo on oo.`number` = o.`batch_number` and oo.user_org_id = ?", org_id)
1117 1117
 
1118 1118
 	err = db.Where(" oi.user_org_id = ?  AND o.record_date >= ? AND o.record_date <= ? AND oi.status = 1", org_id, start_time, end_time).Scan(&patients).Error
1119 1119
 	return

+ 1 - 1
service/his_summary_service.go Dosyayı Görüntüle

@@ -297,7 +297,7 @@ func GetHisLastOrder(org_id int64, patient_id int64, start_time int64, end_time
297 297
 
298 298
 	order := models.HisOrder{}
299 299
 
300
-	err := XTReadDB().Where("user_org_id = ? and patient_id = ? and ctime>=? and ctime<=? and fa_piao_number<> ''", org_id, patient_id, start_time, end_time).Last(&order).Error
300
+	err := XTReadDB().Where("user_org_id = ? and patient_id = ? and ctime>=? and ctime<=? and status = 1", org_id, patient_id, start_time, end_time).Last(&order).Error
301 301
 	return order, err
302 302
 }
303 303