Commit 94a8d122 authored by zhaofei's avatar zhaofei

s

parent 9fef62dd
...@@ -78,15 +78,18 @@ export default class ActivitSaveController { ...@@ -78,15 +78,18 @@ export default class ActivitSaveController {
const { bothIds, deleteIds } = await activityconfigService.diffPrizeList(activityId, allPrizeList) const { bothIds, deleteIds } = await activityconfigService.diffPrizeList(activityId, allPrizeList)
// 将删除的奖品逻辑删除 // 将删除的奖品逻辑删除
if (deleteIds?.length) {
result = await activityconfigService.deletePrizeByIds(deleteIds) result = await activityconfigService.deletePrizeByIds(deleteIds)
}
if (allPrizeList?.length) {
// 添加和更新奖品 // 添加和更新奖品
const prizeResult = await activityconfigService.insertAndUpdatePrize(activityId, allPrizeList, bothIds) const prizeResult = await activityconfigService.insertAndUpdatePrize(activityId, allPrizeList, bothIds)
if (prizeResult.failed.length) { if (prizeResult.failed.length) {
console.log(prizeResult.failed, '更新奖品失败') console.log(prizeResult.failed, '更新奖品失败')
return resultsModel.error(CODE_TYPES.SYSTEM_ERROR, '保存活动失败') return resultsModel.error(CODE_TYPES.SYSTEM_ERROR, '保存活动失败')
} }
}
if (result || result === 0) { if (result || result === 0) {
return resultsModel.success(true) return resultsModel.success(true)
......
...@@ -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