refactor: 修复知识库和操作指引

This commit is contained in:
2026-03-13 14:32:37 +08:00
parent bbe8e60646
commit 58f42de9df
88 changed files with 3387 additions and 2472 deletions

View File

@@ -32,6 +32,7 @@ class Document extends Model
'markdown_preview',
'conversion_status',
'conversion_error',
'knowledge_base_id',
];
/**
@@ -42,6 +43,14 @@ class Document extends Model
return $this->belongsTo(Group::class);
}
/**
* 获取文档所属的知识库
*/
public function knowledgeBase(): BelongsTo
{
return $this->belongsTo(KnowledgeBase::class);
}
/**
* 获取文档的上传者
*/
@@ -120,6 +129,7 @@ class Document extends Model
'markdown_content' => $this->getMarkdownContent(),
'type' => $this->type,
'group_id' => $this->group_id,
'knowledge_base_id' => $this->knowledge_base_id,
'uploaded_by' => $this->uploaded_by,
'created_at' => $this->created_at?->timestamp,
];