Browse Source

历史排班

28169 1 year ago
parent
commit
121763195a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      service/dialysis_service.go

+ 2 - 2
service/dialysis_service.go View File

@@ -1111,7 +1111,7 @@ func BatchCheckOldDoctorAdvice(m *models.DoctorAdvice, ids []string, org_id int6
1111 1111
 
1112 1112
 func ModifyScheduleMode(mode_id int64, patient_id int64, recordDate int64, org_id int64, dialysis_machine_name string) {
1113 1113
 	ut := writeDb.Begin()
1114
-	err = writeDb.Model(&models.Schedule{}).Where("status = 1   AND user_org_id = ? AND patient_id = ? AND schedule_date >= ?", org_id, patient_id, recordDate).Updates(map[string]interface{}{"updated_time": time.Now().Unix(), "mode_id": mode_id, "dialysis_machine_name": dialysis_machine_name}).Error
1114
+	err = writeDb.Model(&models.Schedule{}).Where("status = 1   AND user_org_id = ? AND patient_id = ? AND schedule_date = ?", org_id, patient_id, recordDate).Updates(map[string]interface{}{"updated_time": time.Now().Unix(), "mode_id": mode_id, "dialysis_machine_name": dialysis_machine_name}).Error
1115 1115
 	if err != nil {
1116 1116
 		ut.Rollback()
1117 1117
 		return
@@ -2093,6 +2093,6 @@ func UpdateLastMonitorRecordToday(accumulated_blood_volume float64, id int64) er
2093 2093
 
2094 2094
 func UpdateDoctorAdviceByExcecute(id int64, user_org_id int64) error {
2095 2095
 
2096
-	err := XTWriteDB().Model(models.DoctorAdvice{}).Where("id = ? and user_org_id = ? and status =1").Updates(map[string]interface{}{"execution_time": 0, "execution_staff": 0, "execution_state": 0}).Error
2096
+	err := XTWriteDB().Model(models.DoctorAdvice{}).Where("id = ? and user_org_id = ? and status =1", id, user_org_id).Updates(map[string]interface{}{"execution_time": 0, "execution_staff": 0, "execution_state": 2}).Error
2097 2097
 	return err
2098 2098
 }