|
@@ -1965,9 +1965,6 @@ func BatchDeleteMonitor(ids []string) (err error) {
|
1965
|
1965
|
|
1966
|
1966
|
func GetPatientDialysisRecordList(patientid int64, startime int64, endtime int64) (order []*models.XtDialysisOrders, err error) {
|
1967
|
1967
|
|
1968
|
|
- //err = XTReadDB().Where("patient_id = ? and dialysis_date>=? and dialysis_date<=? and status = 1", patientid, startime, endtime).Find(&order).Error
|
1969
|
|
- //return order, err
|
1970
|
|
-
|
1971
|
1968
|
db := XTReadDB().Table("xt_dialysis_order as x").Where("x.status = 1")
|
1972
|
1969
|
table := XTReadDB().Table("xt_schedule as s")
|
1973
|
1970
|
fmt.Println(table)
|
|
@@ -1997,14 +1994,14 @@ func BatchDeleteAdvice(ids []int64) (err error) {
|
1997
|
1994
|
|
1998
|
1995
|
}
|
1999
|
1996
|
|
2000
|
|
-func UpdateAutoReduceDetail(good_id int64, count int64) (models.DialysisBeforePrepare, error) {
|
|
1997
|
+func UpdateAutoReduceDetail(good_id int64, count int64, record_time int64) (models.DialysisBeforePrepare, error) {
|
2001
|
1998
|
detail := models.DialysisBeforePrepare{}
|
2002
|
|
- err := XTWriteDB().Model(&detail).Where("good_id = ? and status = 1", good_id).Updates(map[string]interface{}{"count": count}).Error
|
|
1999
|
+ err := XTWriteDB().Model(&detail).Where("good_id = ? and status = 1 and record_time = ?", good_id, record_time).Updates(map[string]interface{}{"count": count}).Error
|
2003
|
2000
|
return detail, err
|
2004
|
2001
|
}
|
2005
|
2002
|
|
2006
|
|
-func DeleteAutoReduceDetail(good_id int64) error {
|
|
2003
|
+func DeleteAutoReduceDetail(good_id int64, record_time int64) error {
|
2007
|
2004
|
detail := models.DialysisBeforePrepare{}
|
2008
|
|
- err := XTWriteDB().Model(&detail).Where("good_id = ? and status = 1", good_id).Updates(map[string]interface{}{"status": 0}).Error
|
|
2005
|
+ err := XTWriteDB().Model(&detail).Where("good_id = ? and status = 1 and record_time = ?", good_id, record_time).Updates(map[string]interface{}{"status": 0}).Error
|
2009
|
2006
|
return err
|
2010
|
2007
|
}
|