sun-pc-linux 1 月之前
父節點
當前提交
fa36c3acf1
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      boxcost/api/stages.go

+ 12 - 0
boxcost/api/stages.go

@@ -90,6 +90,18 @@ func AddStage(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 			"updateTime": time.Now(),
 		},
 	}
+
+	if req.Stages == nil {
+		update = bson.M{
+			"$push": bson.M{
+				"pack.components.$[components].stages": bson.M{
+					"$each": []string{},
+				},
+			},
+		}
+
+	}
+
 	arrayFilters := []interface{}{
 		bson.M{"components.id": req.CompId},
 	}