Commit 94a8d122 authored by zhaofei's avatar zhaofei

s

parent 9fef62dd
...@@ -78,14 +78,17 @@ export default class ActivitSaveController { ...@@ -78,14 +78,17 @@ export default class ActivitSaveController {
const { bothIds, deleteIds } = await activityconfigService.diffPrizeList(activityId, allPrizeList) const { bothIds, deleteIds } = await activityconfigService.diffPrizeList(activityId, allPrizeList)
// 将删除的奖品逻辑删除 // 将删除的奖品逻辑删除
result = await activityconfigService.deletePrizeByIds(deleteIds) if (deleteIds?.length) {
result = await activityconfigService.deletePrizeByIds(deleteIds)
// 添加和更新奖品 }
const prizeResult = await activityconfigService.insertAndUpdatePrize(activityId, allPrizeList, bothIds)
if (prizeResult.failed.length) { if (allPrizeList?.length) {
console.log(prizeResult.failed, '更新奖品失败') // 添加和更新奖品
return resultsModel.error(CODE_TYPES.SYSTEM_ERROR, '保存活动失败') const prizeResult = await activityconfigService.insertAndUpdatePrize(activityId, allPrizeList, bothIds)
if (prizeResult.failed.length) {
console.log(prizeResult.failed, '更新奖品失败')
return resultsModel.error(CODE_TYPES.SYSTEM_ERROR, '保存活动失败')
}
} }
if (result || result === 0) { if (result || result === 0) {
......
...@@ -149,7 +149,7 @@ export default class ActivityConfigService { ...@@ -149,7 +149,7 @@ export default class ActivityConfigService {
}, },
{ {
$set: { $set: {
data, ...data,
updateTime: Date.now(), updateTime: Date.now(),
deleteStatus: DELETE_STATUS.EXIST deleteStatus: DELETE_STATUS.EXIST
} }
......
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