Bladeren bron

提交代码

陈少旭 2 maanden geleden
bovenliggende
commit
0c3f296601
1 gewijzigde bestanden met toevoegingen van 6 en 0 verwijderingen
  1. 6 0
      service/his_project_service.go

+ 6 - 0
service/his_project_service.go Bestand weergeven

@@ -273,6 +273,12 @@ func UpdateHisPrescriptionHisID(his_patient_id int64, patient_id int64, record_t
273 273
 	return
274 274
 }
275 275
 
276
+func UpdateHisPrescriptionHisIDByPID(his_patient_id int64, patient_id int64, record_time int64, org_id int64, ids []string) error {
277
+	err := XTWriteDB().Model(&models.HisPrescription{}).Where("id in (?) and record_date = ? AND user_org_id = ? AND patient_id = ? ", ids, record_time, org_id, patient_id).Updates(map[string]interface{}{"his_patient_id": his_patient_id}).Error
278
+	//XTWriteDB().Model(&models.HisPrescriptionInfo{}).Where("record_date = ? AND user_org_id = ? AND patient_id = ?  AND his_patient_id = 0", record_time, org_id, patient_id).Updates(map[string]interface{}{"his_patient_id": his_patient_id})
279
+	return err
280
+}
281
+
276 282
 func UpdateHisPrescriptionHisIDTwo(his_patient_id int64, patient_id int64, record_time int64, org_id int64, start_time int64) {
277 283
 	XTWriteDB().Model(&models.HisPrescription{}).Where("record_date <= ? AND record_date >= ? AND user_org_id = ? AND patient_id = ? AND his_patient_id = 0 AND order_status <> 2", record_time, start_time, org_id, patient_id).Updates(map[string]interface{}{"his_patient_id": his_patient_id})
278 284
 	XTWriteDB().Model(&models.HisPrescriptionInfo{}).Where("record_date = ? AND user_org_id = ? AND patient_id = ? AND his_patient_id = 0 AND order_status <> 2", record_time, start_time, org_id, patient_id).Updates(map[string]interface{}{"his_patient_id": his_patient_id})