🐛 修复详情取件记录和复制链接回退
This commit is contained in:
@@ -1301,16 +1301,18 @@ class FileService:
|
||||
download_stats = await TransferStats.filter(
|
||||
action="download", file_code_id=file_code.id
|
||||
).order_by("created_at")
|
||||
download_stats = self._dedupe_download_stats(download_stats)
|
||||
download_event_count = len(download_stats)
|
||||
display_download_count = max(int(file_code.used_count or 0), download_event_count)
|
||||
timeline.append(
|
||||
{
|
||||
"key": "retrieved",
|
||||
"status": "done" if file_code.used_count > 0 else "pending",
|
||||
"severity": "success" if file_code.used_count > 0 else "neutral",
|
||||
"status": "done" if display_download_count > 0 else "pending",
|
||||
"severity": "success" if display_download_count > 0 else "neutral",
|
||||
"timestamp": (
|
||||
download_stats[-1].created_at if download_stats else file_code.created_at
|
||||
),
|
||||
"value": file_code.used_count,
|
||||
"value": display_download_count,
|
||||
"event_count": download_event_count,
|
||||
}
|
||||
)
|
||||
for index, stat in enumerate(download_stats, start=1):
|
||||
|
||||
Reference in New Issue
Block a user