Commit 30fbef5c authored by qinhaitao's avatar qinhaitao

fix: 🐛 商品bug

parent 9f43e2d5
......@@ -295,7 +295,7 @@ export default class TaskService extends UserService {
$inc: {
'remainTimes.orderGoods': 0
},
$pushAll: {}
$set: {}
}
let targetOrders = []
......@@ -312,7 +312,12 @@ export default class TaskService extends UserService {
})
}
if (targetOrders.length) {
projection.$pushAll[`taskInfo.${today}.orderGoods`] = targetOrders
if (userInfo.taskInfo[today] && userInfo.taskInfo[today]['orderGoods']) {
const targetList = userInfo.taskInfo[today]['orderGoods'].concat(targetOrders)
projection.$set[`taskInfo.${today}.orderGoods`] = targetList
} else {
projection.$set[`taskInfo.${today}.orderGoods`] = targetOrders
}
}
})
......@@ -499,6 +504,7 @@ export default class TaskService extends UserService {
const updateKeys: object = merge({}, ...needUpdateKeysArray)
logger(updateKeys)
await this.updateUser(id, updateKeys)
return await this.getUserInfo()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment