* [story#69541,0.5h] add getDocBlockContent.

This commit is contained in:
qixinzhi
2024-12-26 09:01:22 +08:00
committed by 代婷婷
parent e3d5287897
commit a6193cb626
+17 -2
View File
@@ -3776,8 +3776,8 @@ class docModel extends model
}
/**
* 获取文档块内容。
* Get doc block content.
* 获取文档块。
* Get doc block.
*
* @param int $blockID
* @access public
@@ -3787,4 +3787,19 @@ class docModel extends model
{
return $this->dao->select('*')->from(TABLE_DOCBLOCK)->where('id')->eq($blockID)->fetch();
}
/**
* 获取文档块内容。
* Get doc block content.
*
* @param int $blockID
* @access public
* @return array|bool
*/
public function getDocBlockContent(int $blockID): array|bool
{
$content = $this->dao->select('content')->from(TABLE_DOCBLOCK)->where('id')->eq($blockID)->fetch('content');
if(!$content) return false;
return json_decode($content, true);
}
}