From 503afdc3c5e14468fc49580a55ac5d6a03c52c4f Mon Sep 17 00:00:00 2001 From: zhouxin Date: Mon, 11 Nov 2024 17:10:03 +0800 Subject: [PATCH] * [task#131758,doing,0.1h] add method to add template type. --- module/doc/model.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/module/doc/model.php b/module/doc/model.php index 2e371b9f79..90e8eb51b5 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -3824,4 +3824,23 @@ class docModel extends model return false; } + + /** + * 添加文档模板类型。 + * Add template type. + * + * @param object $moduleData + * @access public + * @return int + */ + public function addTemplateType($moduleData) + { + $this->dao->insert(TABLE_MODULE)->data($moduleData)->autoCheck()->exec(); + $moduleID = $this->dao->lastInsertID(); + + $path = $moduleData->grade == 1 ? ",{$moduleID}," : ",{$moduleData->parent},{$moduleID},"; + $this->dao->update(TABLE_MODULE)->set('path')->eq($path)->where('id')->eq($moduleID)->exec(); + + return $moduleID; + } }