|
|
@@ -73,10 +73,14 @@ export class UsersAdminController {
|
|
|
|
|
|
@Get('/getDatas')
|
|
|
public async getDatas(@Query() { apiUserId }) {
|
|
|
- const apiNum = await this.usersService.getCount(Number(apiUserId), Role.Api)
|
|
|
- const userNum = await this.usersService.getCount(Number(apiUserId), Role.User)
|
|
|
- const todayNum = await this.usersService.getCount(Number(apiUserId), undefined, format(new Date(), 'yyyy-MM-dd'))
|
|
|
- const week = await this.usersService.getWeekCount(Number(apiUserId))
|
|
|
+ const apiNum = await this.usersService.getCount(apiUserId ? Number(apiUserId) : undefined, Role.Api)
|
|
|
+ const userNum = await this.usersService.getCount(apiUserId ? Number(apiUserId) : undefined, Role.User)
|
|
|
+ const todayNum = await this.usersService.getCount(
|
|
|
+ apiUserId ? Number(apiUserId) : undefined,
|
|
|
+ undefined,
|
|
|
+ format(new Date(), 'yyyy-MM-dd')
|
|
|
+ )
|
|
|
+ const week = await this.usersService.getWeekCount(apiUserId ? Number(apiUserId) : undefined)
|
|
|
return {
|
|
|
api: apiNum,
|
|
|
user: userNum,
|