Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinhaitao
taobao-mini-template
Commits
94a8d122
Commit
94a8d122
authored
Nov 24, 2020
by
zhaofei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
9fef62dd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
save.controller.ts
server/duibats/src/controller/save.controller.ts
+10
-7
activityconfig.service.ts
server/duibats/src/service/activityconfig.service.ts
+1
-1
No files found.
server/duibats/src/controller/save.controller.ts
View file @
94a8d122
...
@@ -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
)
...
...
server/duibats/src/service/activityconfig.service.ts
View file @
94a8d122
...
@@ -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
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment