refactor: 修复知识库和操作指引
This commit is contained in:
@@ -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,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user