fix: 修复秒杀活动发布后状态未更新的问题

根因:publishFlashSale() 只做了缓存预热,从未调用 updateStatus()
将状态从1(未开始)更新为2(进行中),导致发布后UI无变化,
且活动无法被"进行中"查询找到。

修复内容:
- publishFlashSale() 添加 updateStatus(id, 2) 和缓存更新
- 简化 getFlashSaleList 状态查询,直接按 status 字段过滤
- 新增 findByStatus 仓库方法
- 前后端全面支持 PAUSED(status=4) 状态
- 修复管理后台"恢复"按钮错误显示在"已结束"状态上

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-14 17:46:43 +08:00
parent a813d3ffea
commit 0f67f6cc49
7 changed files with 22 additions and 16 deletions

View File

@@ -59,6 +59,7 @@ export const mapFlashSaleStatus = (status: number | string): FlashSale['status']
if (value === 'UPCOMING' || value === 1) return 'UPCOMING'
if (value === 'ACTIVE' || value === 2) return 'ACTIVE'
if (value === 'ENDED' || value === 3) return 'ENDED'
if (value === 'PAUSED' || value === 4) return 'PAUSED'
return 'UPCOMING'
}