Kaynağa Gözat

耗材参数

XMLWAN 4 yıl önce
ebeveyn
işleme
ea9bbbbd1c

+ 4 - 2
controllers/mobile_api_controllers/dialysis_api_controller.go Dosyayı Görüntüle

@@ -4698,7 +4698,8 @@ func (c *DialysisAPIController) UpdateAutoReduceDetail() {
4698 4698
 	good_id, _ := c.GetInt64("good_id")
4699 4699
 	count, _ := c.GetInt64("count")
4700 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 4703
 	c.ServeSuccessJSON(map[string]interface{}{
4703 4704
 		"detail": detail,
4704 4705
 	})
@@ -4709,7 +4710,8 @@ func (c *DialysisAPIController) DeleteAutoReduceDetail() {
4709 4710
 
4710 4711
 	good_id, _ := c.GetInt64("good_id")
4711 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 4715
 	fmt.Print("err", err)
4714 4716
 	c.ServeSuccessJSON(map[string]interface{}{
4715 4717
 		"msg": "批量删除成功",

+ 4 - 4
service/mobile_dialysis_service.go Dosyayı Görüntüle

@@ -1994,14 +1994,14 @@ func BatchDeleteAdvice(ids []int64) (err error) {
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 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 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 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 2006
 	return err
2007 2007
 }