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

@@ -6,6 +6,7 @@ const flashSaleStatusToCode = (status?: string) => {
if (status === 'UPCOMING') return 1
if (status === 'ACTIVE') return 2
if (status === 'ENDED') return 3
if (status === 'PAUSED') return 4
return undefined
}