dd
This commit is contained in:
@ -15,6 +15,14 @@ class ArtifactBll:
|
||||
"""获取官片任务数据"""
|
||||
return self.dal.get_top_artifact(5,"ArtifactID asc")
|
||||
|
||||
def get_artifacting_task(self) -> ArtifactInfoModel:
|
||||
"""获取正在进行的官片任务数据"""
|
||||
loc_item= self.dal.get_top_artifact(1,"","Status=2")
|
||||
if loc_item:
|
||||
return loc_item[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
class PDRecordBll:
|
||||
def __init__(self):
|
||||
"""初始化数据访问层,创建数据库连接"""
|
||||
@ -31,8 +39,10 @@ if __name__ == "__main__":
|
||||
artifact_dal = ArtifactBll()
|
||||
|
||||
artifacts = artifact_dal.get_artifact_task()
|
||||
|
||||
print("\n打印artifacts数据:")
|
||||
for i, artifact in enumerate(artifacts):
|
||||
artifact_id = artifact.ArtifactID
|
||||
# 如果是数据类对象,转换为字典输出
|
||||
if hasattr(artifact, '__dataclass_fields__'):
|
||||
print(f"第{i+1}条: {artifact.__dict__}")
|
||||
|
||||
Reference in New Issue
Block a user