Commit 40d55825 authored by qinhaitao's avatar qinhaitao

feat: 🎸 add Stat

parent f24c72a9
......@@ -33,11 +33,15 @@ export default class StatService {
* @return {boolean}
* @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 { activityId } = this.context.data
const { userNick } = userInfo
return await this.statdao.insertOne({
const id = await this.statdao.insertOne({
activityId,
type,
typeName: STAT_TYPE[type],
......@@ -47,6 +51,7 @@ export default class StatService {
createTime: Date.now(),
createDay: getToday()
})
return { id }
}
async getStats(activityId: string, startDay: string, endDay: string): Promise<any> {
......
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