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
40d55825
Commit
40d55825
authored
Nov 10, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
🎸
add Stat
parent
f24c72a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
stat.service.ts
v2.0/src/service/common/stat.service.ts
+7
-2
No files found.
v2.0/src/service/common/stat.service.ts
View file @
40d55825
...
@@ -33,11 +33,15 @@ export default class StatService {
...
@@ -33,11 +33,15 @@ export default class StatService {
* @return {boolean}
* @return {boolean}
* @memberof StatService
* @memberof StatService
*/
*/
async
addStat
(
type
:
number
,
userInfo
:
IUserInfo
=
{}
as
IUserInfo
,
customStatData
:
object
=
{}):
Promise
<
string
>
{
async
addStat
(
type
:
number
,
userInfo
:
IUserInfo
=
{}
as
IUserInfo
,
customStatData
:
object
=
{}
):
Promise
<
{
id
:
string
}
>
{
const
{
openId
}
=
this
.
context
const
{
openId
}
=
this
.
context
const
{
activityId
}
=
this
.
context
.
data
const
{
activityId
}
=
this
.
context
.
data
const
{
userNick
}
=
userInfo
const
{
userNick
}
=
userInfo
return
await
this
.
statdao
.
insertOne
({
const
id
=
await
this
.
statdao
.
insertOne
({
activityId
,
activityId
,
type
,
type
,
typeName
:
STAT_TYPE
[
type
],
typeName
:
STAT_TYPE
[
type
],
...
@@ -47,6 +51,7 @@ export default class StatService {
...
@@ -47,6 +51,7 @@ export default class StatService {
createTime
:
Date
.
now
(),
createTime
:
Date
.
now
(),
createDay
:
getToday
()
createDay
:
getToday
()
})
})
return
{
id
}
}
}
async
getStats
(
activityId
:
string
,
startDay
:
string
,
endDay
:
string
):
Promise
<
any
>
{
async
getStats
(
activityId
:
string
,
startDay
:
string
,
endDay
:
string
):
Promise
<
any
>
{
...
...
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