浏览代码

🐛 fix(home): 修复时间银行活动查询逻辑

- 移除状态过滤条件,显示所有状态的时间银行活动
- 修改排序字段,从workDate改为startDate以获取准确的最新活动顺序
yourname 8 月之前
父节点
当前提交
109a74148a
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/server/modules/home/home.service.ts

+ 1 - 2
src/server/modules/home/home.service.ts

@@ -200,8 +200,7 @@ export class HomeService {
   async getTimeBankActivities(userId?: number, limit: number = 3): Promise<SilverTimeBank[]> {
   async getTimeBankActivities(userId?: number, limit: number = 3): Promise<SilverTimeBank[]> {
     return await this.timeBankRepo
     return await this.timeBankRepo
       .createQueryBuilder('timeBank')
       .createQueryBuilder('timeBank')
-      .where('timeBank.status = :status', { status: 1 })
-      .orderBy('timeBank.workDate', 'DESC')
+      .orderBy('timeBank.startDate', 'DESC')
       .limit(limit)
       .limit(limit)
       .getMany();
       .getMany();
   }
   }