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
71a295eb
Commit
71a295eb
authored
Jan 07, 2021
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
🐛
follow task
parent
e6b2c904
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
task.service.ts
v2.0/src/service/common/task.service.ts
+8
-2
userUpdate.ts
v2.0/src/utils/common/userUpdate.ts
+4
-0
No files found.
v2.0/src/service/common/task.service.ts
View file @
71a295eb
...
@@ -121,14 +121,20 @@ export default class TaskService extends UserService {
...
@@ -121,14 +121,20 @@ export default class TaskService extends UserService {
}
=
this
.
context
}
=
this
.
context
const
record
=
{
itemId
,
openId
:
taskType
===
'invites'
?
openId
:
undefined
,
...
customRecord
}
const
record
=
{
itemId
,
openId
:
taskType
===
'invites'
?
openId
:
undefined
,
...
customRecord
}
const
result
=
await
this
.
updateUser
(
userInfo
.
_id
,
{
let
updateQuery
:
IUpdateQuery
=
{
$inc
:
{
$inc
:
{
[
`remainTimes.
${
taskType
}
`
]:
rewards
[
`remainTimes.
${
taskType
}
`
]:
rewards
},
},
$push
:
{
$push
:
{
[
`taskInfo.
${
today
}
.
${
taskType
}
`
]:
{
...
record
,
createTime
:
Date
.
now
()
}
[
`taskInfo.
${
today
}
.
${
taskType
}
`
]:
{
...
record
,
createTime
:
Date
.
now
()
}
}
}
})
}
if
(
taskType
===
'follow'
)
{
updateQuery
.
$set
=
{
follow
:
setNewFollowUserData
(
userInfo
.
follow
)
}
}
const
result
=
await
this
.
updateUser
(
userInfo
.
_id
,
updateQuery
)
return
result
?
{
ok
:
1
}
:
CODE_TYPES
.
ERROR_DO_TASK
return
result
?
{
ok
:
1
}
:
CODE_TYPES
.
ERROR_DO_TASK
}
}
...
...
v2.0/src/utils/common/userUpdate.ts
View file @
71a295eb
...
@@ -32,7 +32,11 @@ export function setNewVipUserData(member: IMemberInfo): IMemberInfo {
...
@@ -32,7 +32,11 @@ export function setNewVipUserData(member: IMemberInfo): IMemberInfo {
}
}
export
function
setNewFollowUserData
(
follow
:
IFollowInfo
):
IFollowInfo
{
export
function
setNewFollowUserData
(
follow
:
IFollowInfo
):
IFollowInfo
{
const
followBefore
=
follow
.
flag
const
today
=
getToday
()
const
today
=
getToday
()
if
(
followBefore
||
follow
.
newFollow
)
{
return
follow
}
return
{
return
{
...
follow
,
...
follow
,
newFollow
:
true
,
newFollow
:
true
,
...
...
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