chore: 首页数据统计项目显示

This commit is contained in:
xiaojunnuo
2026-02-27 00:14:53 +08:00
parent 787f6ef528
commit b2c421600c
8 changed files with 72 additions and 22 deletions
@@ -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时间戳转换为日期