Ver código fonte

耗材参数

XMLWAN 4 anos atrás
pai
commit
ea9bbbbd1c

+ 4 - 2
controllers/mobile_api_controllers/dialysis_api_controller.go Ver arquivo

4698
 	good_id, _ := c.GetInt64("good_id")
4698
 	good_id, _ := c.GetInt64("good_id")
4699
 	count, _ := c.GetInt64("count")
4699
 	count, _ := c.GetInt64("count")
4700
 	record_time, _ := c.GetInt64("record_time")
4700
 	record_time, _ := c.GetInt64("record_time")
4701
-	detail, _ := service.UpdateAutoReduceDetail(good_id, count, record_time)
4701
+	patient_id, _ := c.GetInt64("patient_id")
4702
+	detail, _ := service.UpdateAutoReduceDetail(good_id, count, record_time, patient_id)
4702
 	c.ServeSuccessJSON(map[string]interface{}{
4703
 	c.ServeSuccessJSON(map[string]interface{}{
4703
 		"detail": detail,
4704
 		"detail": detail,
4704
 	})
4705
 	})
4709
 
4710
 
4710
 	good_id, _ := c.GetInt64("good_id")
4711
 	good_id, _ := c.GetInt64("good_id")
4711
 	record_time, _ := c.GetInt64("record_time")
4712
 	record_time, _ := c.GetInt64("record_time")
4712
-	err := service.DeleteAutoReduceDetail(good_id, record_time)
4713
+	patient_id, _ := c.GetInt64("patient_id")
4714
+	err := service.DeleteAutoReduceDetail(good_id, record_time, patient_id)
4713
 	fmt.Print("err", err)
4715
 	fmt.Print("err", err)
4714
 	c.ServeSuccessJSON(map[string]interface{}{
4716
 	c.ServeSuccessJSON(map[string]interface{}{
4715
 		"msg": "批量删除成功",
4717
 		"msg": "批量删除成功",

+ 4 - 4
service/mobile_dialysis_service.go Ver arquivo

1994
 
1994
 
1995
 }
1995
 }
1996
 
1996
 
1997
-func UpdateAutoReduceDetail(good_id int64, count int64, record_time int64) (models.DialysisBeforePrepare, error) {
1997
+func UpdateAutoReduceDetail(good_id int64, count int64, record_time int64, patient_id int64) (models.DialysisBeforePrepare, error) {
1998
 	detail := models.DialysisBeforePrepare{}
1998
 	detail := models.DialysisBeforePrepare{}
1999
-	err := XTWriteDB().Model(&detail).Where("good_id = ? and status = 1 and record_date = ?", good_id, record_time).Updates(map[string]interface{}{"count": count}).Error
1999
+	err := XTWriteDB().Model(&detail).Where("good_id = ? and status = 1 and record_date = ? and patient_id", good_id, record_time, patient_id).Updates(map[string]interface{}{"count": count}).Error
2000
 	return detail, err
2000
 	return detail, err
2001
 }
2001
 }
2002
 
2002
 
2003
-func DeleteAutoReduceDetail(good_id int64, record_time int64) error {
2003
+func DeleteAutoReduceDetail(good_id int64, record_time int64, patient_id int64) error {
2004
 	detail := models.DialysisBeforePrepare{}
2004
 	detail := models.DialysisBeforePrepare{}
2005
-	err := XTWriteDB().Model(&detail).Where("good_id = ? and status = 1 and record_date = ?", good_id, record_time).Updates(map[string]interface{}{"status": 0}).Error
2005
+	err := XTWriteDB().Model(&detail).Where("good_id = ? and status = 1 and record_date = ? and patient_id = ?", good_id, record_time, patient_id).Updates(map[string]interface{}{"status": 0}).Error
2006
 	return err
2006
 	return err
2007
 }
2007
 }