mirror of
https://github.com/certd/certd.git
synced 2026-07-20 05:37:32 +08:00
chore: 首页数据统计项目显示
This commit is contained in:
@@ -183,7 +183,7 @@ export class HistoryService extends BaseService<HistoryEntity> {
|
||||
}
|
||||
}
|
||||
|
||||
async countPerDay(param: { days: number; userId?: any }) {
|
||||
async countPerDay(param: { days: number; userId?: any,projectId?:number }) {
|
||||
const todayEnd = dayjs().endOf('day');
|
||||
const where: any = {
|
||||
createTime: MoreThan(todayEnd.add(-param.days, 'day').toDate()),
|
||||
@@ -191,6 +191,9 @@ export class HistoryService extends BaseService<HistoryEntity> {
|
||||
if (param.userId > 0) {
|
||||
where.userId = param.userId;
|
||||
}
|
||||
if (param.projectId > 0) {
|
||||
where.projectId = param.projectId;
|
||||
}
|
||||
const result = await this.getRepository()
|
||||
.createQueryBuilder('main')
|
||||
.select(`${this.dbAdapter.date('main.createTime')} AS date`) // 将UNIX时间戳转换为日期
|
||||
|
||||
Reference in New Issue
Block a user