提交 7f5438ac 编写于 作者: L ljw

修改

上级 a758f13d
......@@ -3,7 +3,7 @@ exports.main = async (event, context) => {
const db = uniCloud.database()
const collection = db.collection('mustgo-user')
const activitycollection = db.collection('mustgo-team-activity')
const registration = db.collection('mustgo-registration')
let res1 = await collection.where({
_id: event.userId
......@@ -42,7 +42,11 @@ exports.main = async (event, context) => {
const res1 = await collection1.doc(teamid).remove()
const tmp2 = await activitycollection.where({
team_id:teamid
team_id: teamid
}).remove()
const tmp3 = await registration.where({
owner_id: event.userId
}).remove()
}
......@@ -56,25 +60,27 @@ exports.main = async (event, context) => {
team_id: teamid
}).get()
const registration = db.collection('mustgo-registration')
let res3 = await registration.where({
owner_id: event.userId
}).get()
var arr = new Array;
arr = res3.data
// return arr
for (var i = 0; i < arr.length; i++) {
let res4 = await activity.where({
_id:arr[i]["team_activity_id"]
_id: arr[i]["team_activity_id"]
}).get()
// return res4
const res = await activitycollection.doc(arr[i]["team_activity_id"]).update({
enrollment: res4.data[0]["enrollment"] - 1
})
const restep = await registration.where({
_id:arr[i]["_id"]
}).remove()
// const restep = await registration.where({
// _id:arr[i]["_id"]
// }).remove()
const resreg = await registration.doc(arr[i]["_id"]).remove()
}
return {
"code": 200,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册