Эх сурвалжийг харах

fix:数据删除问题修改

duxin 1 жил өмнө
parent
commit
8435f1ba95

+ 10 - 2
src/jfw/modules/subscribepay/src/service/dataexportPack.go

@@ -72,7 +72,15 @@ func (des *DataExportPack) ScreenList() {
 func (des *DataExportPack) ScreenDelete() {
 	err := func() error {
 		userid := des.GetSession("userId")
-		ids := des.GetString("ids")
+		if len(des.Body()) == 0 {
+			return errors.New("body数据异常")
+		}
+		data := make(map[string]interface{})
+		err := json.Unmarshal(des.Body(), &data)
+		if err != nil {
+			return errors.New("获取ids失败")
+		}
+		ids := qutil.InterfaceToStr(data["ids"])
 		var idArr []primitive.ObjectID
 		for _, v := range strings.Split(ids, ",") {
 			if id := encrypt.SE.DecodeString(v); id != "" {
@@ -83,7 +91,7 @@ func (des *DataExportPack) ScreenDelete() {
 		//log.Println("userid", userid, idArr)
 		util.MQFW.Delete("export_condition", map[string]interface{}{
 			"user_id": userid,
-			"id": map[string]interface{}{
+			"_id": map[string]interface{}{
 				"$in": idArr,
 			},
 		})