This commit is contained in:
jxxghp 2023-06-28 12:49:38 +08:00
parent cbbec6af7d
commit 0c2de23735
2 changed files with 5 additions and 1 deletions

View File

@ -42,7 +42,7 @@ class TransferHistory(Base):
# 转移失败信息
errmsg = Column(String)
# 时间
date = Column(String, index=True, default=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
date = Column(String, index=True)
@staticmethod
def list_by_title(db: Session, title: str, page: int = 1, count: int = 30):

View File

@ -1,3 +1,4 @@
import time
from typing import Any
from app.db import DbOper
@ -24,4 +25,7 @@ class TransferHistoryOper(DbOper):
transferhistory = TransferHistory.get_by_hash(self._db, kwargs.get("download_hash"))
if transferhistory:
transferhistory.delete(self._db, transferhistory.id)
kwargs.update({
"date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
})
return TransferHistory(**kwargs).create(self._db)